Difference between revisions of "Template:TrackListEntry"

From Video Game Music Preservation Foundation Wiki
Jump to: navigation, search
(Update microdata attributes)
(Replace spans with meta elements now they are permitted)
Line 112: Line 112:
 
     <td>{{{Extra4}}}</td>}}{{#if:{{{Extra5|}}}|
 
     <td>{{{Extra4}}}</td>}}{{#if:{{{Extra5|}}}|
 
     <td>{{{Extra5}}}</td>}}
 
     <td>{{{Extra5}}}</td>}}
     <td style="text-align:right;">{{{DurationMin|0}}}:{{#ifexpr:{{{DurationSec|0}}} < 10|0}}{{{DurationSec|0}}}<span itemprop="duration" style="display: none;">PT{{{DurationMin|0}}}M{{{DurationSec|0}}}S</span></td>
+
     <td style="text-align:right;">{{{DurationMin|0}}}:{{#ifexpr:{{{DurationSec|0}}} < 10|0}}{{{DurationSec|0}}}<meta itemprop="duration" content="PT{{{DurationMin|0}}}M{{{DurationSec|0}}}S" /></td>
 
     <td style="text-align:right;">{{{Size}}}</td>{{#if:{{{Extra6|}}}|
 
     <td style="text-align:right;">{{{Size}}}</td>{{#if:{{{Extra6|}}}|
 
     <td>{{{Extra6}}}</td>}}{{#if:{{{Extra7|}}}|
 
     <td>{{{Extra6}}}</td>}}{{#if:{{{Extra7|}}}|
Line 121: Line 121:
 
Normal download link:
 
Normal download link:
  
--><span itemprop="audio">[[Media:{{#if:{{{Recording|}}} | {{{Recording|}}} | {{ZeroPad|{{{Track|0}}}}}_-_{{{Game}}}_-_{{#if:{{{Platform|}}}|{{{Platform}}}_-_}}{{{Title}}}.ogg}}|Download]]</span><!--
+
-->[[Media:{{#if:{{{Recording|}}} | {{{Recording|}}} | {{ZeroPad|{{{Track|0}}}}}_-_{{{Game}}}_-_{{#if:{{{Platform|}}}|{{{Platform}}}_-_}}{{{Title}}}.ogg}}|Download]]<!--
  
Hidden 'a' link which points to the "url" microdata attribute of the song.  This picks whichever page exists first, in this order:
+
Direct file link for "audio" microdata attribute:
 +
 
 +
--><meta itemprop="audio" content="{{fullurl:Media:{{#if:{{{Recording|}}} | {{{Recording|}}} | {{ZeroPad|{{{Track|0}}}}}_-_{{{Game}}}_-_{{#if:{{{Platform|}}}|{{{Platform}}}_-_}}{{{Title}}}.ogg}}" /><!--
 +
 
 +
Hidden content which points to the "url" microdata attribute of the song.  This picks whichever page exists first, in this order:
  
 
  * TitleLink parameter
 
  * TitleLink parameter
Line 132: Line 136:
 
This should always return a working link.  Unlike the clickable link shown on the page, this will fall back to the game's page if there's no song-specific page, to ensure the "url" microdata attribute will always take you to a useful page.
 
This should always return a working link.  Unlike the clickable link shown on the page, this will fall back to the game's page if there's no song-specific page, to ensure the "url" microdata attribute will always take you to a useful page.
  
--><span style="display: none;" itemprop="url">[{{fullurl:{{{TitleLink|{{#ifexist:{{{Title}}} - {{{Game}}} ({{{Platform}}})|{{{Title}}} - {{{Game}}} ({{{Platform}}})|{{{Title|{{FULLPAGENAME}}}}}}} }}} }} {{{Title}}}]</span><!--
+
It would be better to put the "url" attribute on an actual link instead of a meta tag, but MediaWiki doesn't allow arbitrary tags on links.
 +
 
 +
--><meta itemprop="url" content="{{fullurl:{{{TitleLink|{{#ifexist:{{{Title}}} - {{{Game}}} ({{{Platform}}})|{{{Title}}} - {{{Game}}} ({{{Platform}}})|{{{Title|{{FULLPAGENAME}}}}}}} }}} }}" /><!--
  
 
Hidden element with the album name for microdata.  This is just "Game (Platform)" (or just "Game" if there's no platform specified).
 
Hidden element with the album name for microdata.  This is just "Game (Platform)" (or just "Game" if there's no platform specified).
  
--><span style="display: none;" itemprop="inAlbum">{{{Game}}} {{#if:{{{Platform|}}}|({{{Platform}}})}}</span><!--
+
--><meta itemprop="inAlbum" content="{{{Game}}} {{#if:{{{Platform|}}}|({{{Platform}}})}}" /><!--
  
 
--></td>{{#if:{{{Extra8|}}}|
 
--></td>{{#if:{{{Extra8|}}}|

Revision as of 20:25, 4 February 2015

This template is used to start a table of song recordings. It is combined with Template:TrackListBegin and Template:TrackListEnd to produce the full table of recordings.

Tables produced with this template contain structured data allowing search engines to list the recordings directly in the search results.

The following parameters are valid:

Parameter Example Purpose
Track Track = 1 Track number (do not use leading zeroes).
Title Title = A Song Song title.
TitleLink (optional) TitleLink = A Song (Example Game) Link to the song's page, if it is different to the song title. Only use this if the page for the song is actually named differently to the song title, and the page cannot be renamed. The default link is:
  • "Title - Game (Platform)", if that page exists (e.g. Map - Rampage (NES)).
  • Otherwise the link is just Title (e.g. Map).

Only use this parameter where it is not possible to rename the song page so that it fits the standard wiki naming scheme.

Artist Artist = John Doe Name of the artist.
ArtistLink (optional) Artist = John Doe Link to the artist's page, if it is different to their name. Only use this parameter if you have to.
DurationMin
DurationSec
DurationMin = 1
DurationSec = 23
Length of the song, split into minutes and seconds as separate parameters. The example produces a song length of 1:23.
Size Size = 2 MB Size of the audio recording, in "pretty" values (kB, MB, etc.)
Game Game = Example Game Name of the game this song is from. This is used to populate the 'album' fields.
Platform Platform = DOS Game platform. This is used to populate the 'album' fields.
Recording (optional) Recording = Filename.ogg Filename of the recording. Avoid using this parameter if possible. The default filename is "Track - Game - Platform - Title.ogg" with Track padded with a leading zero if needed, so it is always two digits long.

Example

This code:

{{TrackListBegin}}
{{TrackListEntry
 | Track = 1
 | Title = Example
 | Artist = John Doe
 | DurationMin = 1
 | DurationSec = 23
 | Size = 1.23 MB
 | Game = Example
 | Platform = DOS
}}
{{TrackListEnd}}

Will appear as:

# Title Composer Length Listen Download
01 Example Unknown 1:23 Download

Development

This section is used to preview changes to the template code during development.

# Title Composer Length Listen Download
? [[{{{Title}}}]] [[{{{Artist}}}|{{{Artist}}}]] 0:00 {{{Size}}} [[Media:00_-_{{{Game}}}_-_{{{Title}}}.ogg|Download]]