Template:Spotify: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
(Created page with "<includeonly><div style="float:right;clear:right;height:100px;"> <spotify uri="spotify:album:{{{1}}}" height="200" /> </div></includeonly><noinclude>[[Category:Template sandbo...")
Tag: sourceedit
 
No edit summary
Tags: Mobile edit Mobile web edit
 
(40 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly><div style="float:right;clear:right;height:100px;">
<includeonly>{{#if:{{{playlist|}}}{{{episode|}}}{{{show|}}}||<div class="spotify-thumb" style="{{#ifeq:{{{align|}}}|left|float:left;clear:left;margin-left:0;margin-right:12px;|}}">
<spotify uri="spotify:album:{{{1}}}" height="200" />
{{#ev:spotify{{#if:{{{album|}}}|album|{{#if:{{{artist|}}}|artist|{{#if:{{{track|}}}|track|album}}}}}}|{{{album|}}}{{{track|}}}{{{artist|}}}{{{playlist|}}}{{{episode|}}}{{{show|}}}{{{1|}}}|250x200}}
</div></includeonly><noinclude>[[Category:Template sandbox|Spotify thumb]]</noinclude>
</div>}}</includeonly><noinclude>{{documentation}}[[Category:Media templates]]</noinclude>

Latest revision as of 00:26, 30 March 2024

Instructions for {{Spotify}}
The {{spotify}} template creates Spotify embeds on articles. Usage is simple. Spotify URLs are typically split into six types:
  • artist
  • album
  • track
  • playlist
  • episode
  • show

Currently, playlist, episode and show do not work. Support may be added in the future. Each of these will be followed by a long string of gibberish.

Let's consider Jubilee as our primary example here. You can easily extract the information you need from either the URI (spotify:album:2KavEgxLOcjbZq8OqoFiMD) or from a simple URL (https://open.spotify.com/album/2KavEgxLOcjbZq8OqoFiMD).

  • {{spotify|album=5nuQd8ibwND43GAVP9FT0B}} will generate the Spotify embed seen on the right.

Simple right? The same exact logic applies to the other URL types we mentioned. By default, {{Spotify}} appears as an floating player aligned to the right side of the page.

They can also be aligned to the left side instead.

align=left produces such a left-aligned Spotify object.

{{spotify|album=62Pk4ZZI82TmstwutgjPod|align=left}}

Spotify is not available in quite all countries, and not all users will have an account to listen with on the page directly.