Difference between revisions of "Tracklist"

From Sega Retro

m
Line 1: Line 1:
<div class="tracklist"><div style="display:none">{{#vardefine:time|0}}{{#vardefine:num|1}}{{#vardefine:side|}}{{#if: {{{hidetime|}}} | {{#vardefine:hidetimeall|1}}[[Category:Unknown running time]] | }}</div>
+
<includeonly><div class="tracklist">{{let|time=0|num=1|side=}}
{{{1}}}
+
{{{1|}}}
{{#if: {{{hidetime|}}} | | {{{!}}
+
{{#switch:{{#var:time}}|0=[[Category:Unknown running time]]|#default=<div style="text-align:left; border-top:solid 1px #DDDDDD;"> ► '''Running time: {{time|{{#var:time}}}}'''</div>}}</div></includeonly><noinclude>
!style="text-align:left"{{!}} ► '''Running time: {{time|{{#var:time}}}}'''
+
==Usage==
{{!}}}
+
<pre>
}}</div>{{#ifeq: {{#var:time}} | 0 | <includeonly>[[Category:Unknown running time]]</includeonly> }}<noinclude>
+
{{tracklist|
 +
{{track|Track title|time=1:23|artist=Artist name}}
 +
}}
 +
</pre>
 +
returns:
 +
{{tracklist|
 +
{{track|Track title|time=1:23|artist=Artist name}}
 +
}}
 +
 
 +
 
 +
<pre>
 +
{{tracklist|
 +
{{track|Track title|side=A}}
 +
{{track|Track title 2}}
 +
}}
 +
</pre>
 +
returns:
 +
{{tracklist|
 +
{{track|Track title|side=A}}
 +
{{track|Track title 2}}
 +
}}
 +
 
 +
 
 +
<pre>
 +
{{tracklist|
 +
{{track|Track title|track=99}}
 +
{{track|Track title 2}}
 +
}}
 +
</pre>
 +
returns:
 +
{{tracklist|
 +
{{track|Track title|track=99}}
 +
{{track|Track title 2}}
 +
}}
 
[[Category:Sega Retro templates]]
 
[[Category:Sega Retro templates]]
 
</noinclude>
 
</noinclude>

Revision as of 20:21, 17 June 2021

Usage

{{tracklist|
{{track|Track title|time=1:23|artist=Artist name}}
}}

returns:

1. Artist name — Track title (1:23) 
Running time: 1:23


{{tracklist|
{{track|Track title|side=A}}
{{track|Track title 2}}
}}

returns:

A1. Track title  
A2. Track title 2  


{{tracklist|
{{track|Track title|track=99}}
{{track|Track title 2}}
}}

returns:

99. Track title  
100. Track title 2