Template:Spotify/doc: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
No edit summary
Tag: sourceedit
No edit summary
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The '''{{tlx|spotify}}''' template creates [https://spotify.com Spotify] embeds on articles. Usage is simple. [[Spotify]] URLs are typically split into four types:
The '''{{tlx|spotify}}''' template creates [https://spotify.com Spotify] embeds on articles. Usage is simple. [[Spotify]] URLs are typically split into six types:
* <tt>artist</tt>
* <tt>artist</tt>
* <tt>album</tt>
* <tt>album</tt>
* <tt>track</tt>
* <tt>track</tt>
* <tt>playlist</tt>
* <tt>playlist</tt>
Each of these will be following by a long string of gibberish.
* <tt>episode</tt>
* <tt>show</tt>
Currently, <tt>playlist</tt>, <tt>episode</tt> and <tt>show</tt> 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 (audio story)|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).
Let's consider ''[[Jubilee (audio story)|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=2KavEgxLOcjbZq8OqoFiMD}}
{{spotify|album=5nuQd8ibwND43GAVP9FT0B}}
* {{tlx|spotify|album{{=}}2KavEgxLOcjbZq8OqoFiMD}} will generate the Spotify embed seen on the right.
* {{tlx|spotify|album{{=}}5nuQd8ibwND43GAVP9FT0B}} will generate the Spotify embed seen on the right.


Simple right? The same exact logic applies to the three other URL types we mentioned. By default, {{tlc|Spotify}} appears as a small thumbnail-sized object, aligned to the right side of the page.
Simple right? The same exact logic applies to the other URL types we mentioned. By default, {{tlc|Spotify}} appears as an floating player aligned to the right side of the page.


Spotify embeds can not only have different heights, though, but can also align to the left side instead.
They can also be aligned to the left side instead.
{{spotify|album=06g7UaRPgFUnCpcvSHsvUw|align=left}}
{{spotify|album=62Pk4ZZI82TmstwutgjPod|align=left}}
<tt>'''align{{=}}left'''</tt> produces such a left-aligned Spotify object.
<tt>'''align{{=}}left'''</tt> produces such a left-aligned Spotify object.
{{spotify|album=7idJpl3Xvma03BAyURhehj|align=left|height=280}}
: {{tlx|spotify|album{{=}}62Pk4ZZI82TmstwutgjPod|align{{=}}left}}
{{spotify|album=4WTfQ5kBKSEQCMrDhrIBf6|height=350}}
{{spotify|album=31jF76xCxwjlA5qRFSBZFx|align=left}}


:To achieve a longer (yet thinner) object, with greater control to it, use one of the following <tt>'''height'''</tt> options:
Spotify is not available in quite ''all'' countries, and not all users will have an account to listen with on the page directly.
::::<big><tt>'''280'''</tt>, <tt>'''350'''</tt> or <tt>'''380'''</tt></big>.
 
:<tt>280</tt> is, of course, preferable, as it takes up less space on the page. Take caution in using these larger Spotify embeds, not to take away too much from space for content. Spotify is not available in quite ''all'' countries, and not all users will have an account to listen with on the page directly.


<noinclude>[[category:template documentation|{{PAGENAME}}]]</noinclude>
<noinclude>[[category:template documentation|{{PAGENAME}}]]</noinclude>

Latest revision as of 20:11, 20 February 2024

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.