Difference between revisions of "Template:TrackListEntry"

From Video Game Music Preservation Foundation Wiki
Jump to: navigation, search
m (microdata: Add sameAs attribute to identify album)
m (Protected "Template:TrackListEntry" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
 
(5 intermediate revisions by 2 users not shown)
Line 19: Line 19:
 
| '''TitleLink''' (optional)
 
| '''TitleLink''' (optional)
 
| <tt>TitleLink&nbsp;=&nbsp;A&nbsp;Song&nbsp;(Example&nbsp;Game)</tt>
 
| <tt>TitleLink&nbsp;=&nbsp;A&nbsp;Song&nbsp;(Example&nbsp;Game)</tt>
| 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:
+
| Link to the song's page, if it is different to the song title. You don't need to use this if the title follows the standard Wiki scheme. The title link will automatically redirect to song pages as they become available. It will first check for a specific platform, then a specific game, and finally, the generic song title. For example:
* "''Title'' - ''Game'' (''Platform'')", if that page exists (e.g. [[Map - Rampage (NES)]]).
+
# "''Title'' - ''Game'' (''Platform'')", if that page exists (e.g. [[Map - Rampage (NES)]]).
* Otherwise the link is just ''Title'' (e.g. [[Map]]).
+
# "''Title'' - ''Game''", if that page exists (e.g. [[Main Theme - Ski or Die]]).
Only use this parameter where it is not possible to rename the song page so that it fits the standard wiki naming scheme.
+
# Otherwise the link is just ''Title'' (e.g. [[Map]]).
 +
This parameter should only be used when the song page doesn't follow the Wiki scheme. For example the [[Boppin' (DOS)]] song "Boppin Opus #43" cannot have the "#" symbol in an article name, so it needs a ''TitleLink'' of "Boppin Opus 43" without the hash symbol.
 +
 
 +
Note that if you supply this parameter, it is used in place of the song title for all wiki links, such as the auto-generated song recording file name. (You can still override that with the ''Recording'' parameter of course.)
 
|-
 
|-
 
| '''Composer'''
 
| '''Composer'''
| <tt><nowiki>Composer = {{TrackListComposer|John Doe}}</nowiki></tt><br/><tt><nowiki>Composer = {{TrackListComposer|John Doe|Johnny Doe}}, {{TrackListComposer|Robert Smith|Bob Smith}}</nowiki></tt>
+
| <tt><nowiki>Composer = {{TrackListComposer|John Doe}}</nowiki></tt>
| Name of the composer(s). Only one ''Composer'' option can be specified, so multiple composers should be comma separated.  Remember to surround composer names with the [[:Template:TrackListComposer]] template. Template use is <nowiki>{{TrackListComposer|Article name|Credited name}}</nowiki> where the ''credited name'' is as per the game credits, and the ''article name'' is the destination wiki page to link to.  The ''credited name'' parameter can be omitted when it is the same as the ''article name''.
+
| Name of the composer(s). Each composer should use the [[:Template:TrackListComposer]] template. If multiple composers collaborated on a song, separate each template with a comma. Example: <nowiki>{{TrackListComposer|John Doe}}, {{TrackListComposer|Steve Smith}}</nowiki>. The name in the template must be the composer's page name. If the composer is credited with an alias or a name variation, document the alias in the Credits section only.
 
|-
 
|-
 
| '''DurationMin'''<br/>'''DurationSec'''
 
| '''DurationMin'''<br/>'''DurationSec'''
 
| <tt>DurationMin = 1<br/>DurationSec = 23</tt>
 
| <tt>DurationMin = 1<br/>DurationSec = 23</tt>
| Length of the song, split into minutes and seconds as separate parameters. The example produces a song length of 1:23.
+
| Length of the song, split into minutes and seconds as separate parameters. The example produces a song length of 1:23.
 
|-
 
|-
 
| '''Game'''
 
| '''Game'''
 
| <tt>Game = Example Game</tt>
 
| <tt>Game = Example Game</tt>
| Name of the game this song is from. This is used to populate the 'album' fields.
+
| Name of the game this song is from. This is used to populate the 'album' fields.
 
|-
 
|-
 
| '''Platform'''
 
| '''Platform'''
 
| <tt>Platform = DOS</tt>
 
| <tt>Platform = DOS</tt>
| Game platform. This is used to populate the 'album' fields.
+
| Game platform code. This is used to populate the 'album' fields.
 
|-
 
|-
 
| '''Recording'''&nbsp;(optional)
 
| '''Recording'''&nbsp;(optional)
 
| <tt>Recording = Filename.ogg</tt>
 
| <tt>Recording = Filename.ogg</tt>
| 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.
+
| File name of the recording. Avoid using this parameter if possible. The default file name is "''Track'' - ''Game'' - ''Platform'' - ''Title''.ogg" with ''Track'' padded with a leading zero if needed, so it is always two digits long.
 
|}
 
|}
  
Line 87: Line 90:
 
     <td itemprop="name"><!--
 
     <td itemprop="name"><!--
  
Link with song title as "name" microdata attribute. The link target is the first valid page, in this order:
+
Link with song title as "name" microdata attribute. The link target is the first valid page, in this order:
  
 
  * TitleLink parameter
 
  * TitleLink parameter
 
  * Title - Game (Platform)
 
  * Title - Game (Platform)
 +
* Title - Game
 
  * Title
 
  * Title
  
-->{{#if:{{{TitleLink|}}} | [[{{{TitleLink}}}|{{{Title}}}]] | {{#ifexist:{{{Title}}} - {{{Game}}} ({{{Platform}}})| [[{{{Title}}} - {{{Game}}} ({{{Platform}}})|{{{Title}}}]] | [[{{{Title}}}]] }} }}<!--
+
-->{{#if:{{{TitleLink|}}}|<!--
 +
    -->[[{{{TitleLink}}}|{{{Title}}}]]<!--
 +
-->|<!--
 +
    -->{{#ifexist:{{{Title}}} - {{{Game}}} ({{{Platform}}})|<!--
 +
        -->[[{{{Title}}} - {{{Game}}} ({{{Platform}}})|{{{Title}}}]]<!--
 +
    -->|<!--
 +
        -->{{#ifexist:{{{Title}}} - {{{Game}}}|<!--
 +
            -->[[{{{Title}}} - {{{Game}}}|{{{Title}}}]]<!--
 +
        -->|<!--
 +
            -->[[{{{Title}}}]]<!--
 +
        -->}}<!--
 +
    -->}}<!--
 +
-->}}<!--
  
 
--></td>{{#if:{{{Extra1|}}}|
 
--></td>{{#if:{{{Extra1|}}}|
Line 106: Line 122:
 
     <td>{{{Extra6}}}</td>}}{{#if:{{{Extra7|}}}|
 
     <td>{{{Extra6}}}</td>}}{{#if:{{{Extra7|}}}|
 
     <td>{{{Extra7}}}</td>}}
 
     <td>{{{Extra7}}}</td>}}
     <td>{{Song-List|{{#if:{{{Recording|}}} | {{{Recording|}}} | {{ZeroPad|{{{Track|0}}}}}_-_{{{Game}}}_-_{{#if:{{{Platform|}}}|{{{Platform}}}_-_}}{{{Title}}}.ogg}} }}</td>
+
     <td>{{Song-Box|{{#if:{{{Recording|}}} | {{{Recording|}}} | {{ZeroPad|{{{Track|0}}}}}_-_{{{Game}}}_-_{{#if:{{{Platform|}}}|{{{Platform}}}_-_}}{{{TitleLink|{{{Title}}}}}}.ogg}} }}</td>
 
     <td itemprop="recordedAs" itemscope itemtype="http://schema.org/MusicRecording"><meta itemprop="duration" content="PT{{{DurationMin|0}}}M{{{DurationSec|0}}}S" /><!--
 
     <td itemprop="recordedAs" itemscope itemtype="http://schema.org/MusicRecording"><meta itemprop="duration" content="PT{{{DurationMin|0}}}M{{{DurationSec|0}}}S" /><!--
  
 
Normal download link:
 
Normal download link:
  
-->[[Media:{{#if:{{{Recording|}}} | {{{Recording|}}} | {{ZeroPad|{{{Track|0}}}}}_-_{{{Game}}}_-_{{#if:{{{Platform|}}}|{{{Platform}}}_-_}}{{{Title}}}.ogg}}|Download]]<!--
+
-->[[Media:{{#if:{{{Recording|}}} | {{{Recording|}}} | {{ZeroPad|{{{Track|0}}}}}_-_{{{Game}}}_-_{{#if:{{{Platform|}}}|{{{Platform}}}_-_}}{{{TitleLink|{{{Title}}}}}}.ogg}}|Download]]<!--
  
 
Direct file link for "audio" microdata attribute:
 
Direct file link for "audio" microdata attribute:
  
--><span itemprop="audio" itemscope itemtype="http://schema.org/AudioObject"><meta itemprop="contentUrl" content="{{fullurl:Media:{{#if:{{{Recording|}}} | {{{Recording|}}} | {{ZeroPad|{{{Track|0}}}}}_-_{{{Game}}}_-_{{#if:{{{Platform|}}}|{{{Platform}}}_-_}}{{{Title}}}.ogg}}}}" /></span><!--
+
--><span itemprop="audio" itemscope itemtype="http://schema.org/AudioObject"><meta itemprop="contentUrl" content="{{fullurl:Media:{{#if:{{{Recording|}}} | {{{Recording|}}} | {{ZeroPad|{{{Track|0}}}}}_-_{{{Game}}}_-_{{#if:{{{Platform|}}}|{{{Platform}}}_-_}}{{{TitleLink|{{{Title}}}}}}.ogg}}}}" /></span><!--
  
 
Hidden content which points to the "url" microdata attribute of the song.  This picks whichever page exists first, in this order:
 
Hidden content which points to the "url" microdata attribute of the song.  This picks whichever page exists first, in this order:
Line 124: Line 140:
 
  * Current page (i.e. "Game (Platform)")
 
  * Current page (i.e. "Game (Platform)")
  
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.
  
 
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.
 
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.
Line 130: Line 146:
 
--><meta itemprop="url" content="{{fullurl:{{{TitleLink|{{#ifexist:{{{Title}}} - {{{Game}}} ({{{Platform}}})|{{{Title}}} - {{{Game}}} ({{{Platform}}})|{{{Title|{{FULLPAGENAME}}}}}}} }}} }}" /><!--
 
--><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). Also includes a URL for the album which is the wiki page displaying the track list.
+
Hidden element with the album name for microdata. This is just "Game (Platform)" (or just "Game" if there's no platform specified). Also includes a URL for the album which is the wiki page displaying the track list.
  
 
--><span itemprop="inAlbum" itemscope itemtype="http://schema.org/MusicAlbum"><meta itemprop="name" content="{{{Game}}} {{#if:{{{Platform|}}}|({{{Platform}}})}}" /><meta itemprop="url" content="{{canonicalurl:{{FULLPAGENAME}}}}" /><meta itemprop="sameAs" content="{{canonicalurl:{{FULLPAGENAME}}}}" /></span><!--
 
--><span itemprop="inAlbum" itemscope itemtype="http://schema.org/MusicAlbum"><meta itemprop="name" content="{{{Game}}} {{#if:{{{Platform|}}}|({{{Platform}}})}}" /><meta itemprop="url" content="{{canonicalurl:{{FULLPAGENAME}}}}" /><meta itemprop="sameAs" content="{{canonicalurl:{{FULLPAGENAME}}}}" /></span><!--

Latest revision as of 16:42, 15 December 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. You don't need to use this if the title follows the standard Wiki scheme. The title link will automatically redirect to song pages as they become available. It will first check for a specific platform, then a specific game, and finally, the generic song title. For example:
  1. "Title - Game (Platform)", if that page exists (e.g. Map - Rampage (NES)).
  2. "Title - Game", if that page exists (e.g. Main Theme - Ski or Die).
  3. Otherwise the link is just Title (e.g. Map).

This parameter should only be used when the song page doesn't follow the Wiki scheme. For example the Boppin' (DOS) song "Boppin Opus #43" cannot have the "#" symbol in an article name, so it needs a TitleLink of "Boppin Opus 43" without the hash symbol.

Note that if you supply this parameter, it is used in place of the song title for all wiki links, such as the auto-generated song recording file name. (You can still override that with the Recording parameter of course.)

Composer Composer = {{TrackListComposer|John Doe}} Name of the composer(s). Each composer should use the Template:TrackListComposer template. If multiple composers collaborated on a song, separate each template with a comma. Example: {{TrackListComposer|John Doe}}, {{TrackListComposer|Steve Smith}}. The name in the template must be the composer's page name. If the composer is credited with an alias or a name variation, document the alias in the Credits section only.
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.
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 code. This is used to populate the 'album' fields.
Recording (optional) Recording = Filename.ogg File name of the recording. Avoid using this parameter if possible. The default file name 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
 | Composer = {{TrackListComposer|John Doe}}
 | DurationMin = 1
 | DurationSec = 23
 | Game = Example
 | Platform = DOS
}}
{{TrackListEnd}}

Will appear as:

# Title Composer Length Listen Download
01 Example John Doe 1:23 Download

Development

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

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