Template:Media table: Difference between revisions

From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
mNo edit summary
mNo edit summary
 
(143 intermediate revisions by 15 users not shown)
Line 1: Line 1:
[[Image:Soundcheck.png|25px|right]] The {{SITENAME}} has {{#if:{{{name2|}}}||a}} media file{{#if:{{{name2|}}}|s}} for ''{{PAGENAME}}''. To view the audio or video, click the name of the file. Details for each file succeed the link. <hr width=90%>
<includeonly><div style="display:flow-root;margin-top:1em">{{#forargs:file|key|value|{{media table/row|type={{{type{{#var:key}}|{{#switch:{{lc:{{#sub:{{#var:value}}|-4}}}}|.ogv|.mp4|.mpg|mpeg|webm=video}}}}}|file={{#var:value}}|title={{{title{{#var:key}}|}}}|description={{{description{{#var:key}}|}}}|length={{{length{{#var:key}}|}}}|check={{{check{{#var:key}}|}}}}}}}</div><templatestyles src="Media table/styles.css"/>
<!-- BIG MESS AHEAD -- ONLY EDIT IF YOU KNOW THE CODE -->
:<small>[[Help:Media]] [[wikipedia:Help:Media (audio and video)|Having trouble playing?]]</small></includeonly><noinclude>
{{#if:{{{name1|}}}|<table style="padding:4px;width:100%"><tr><td>{{#switch:{{{type1}}}|audio|Audio=[[Image:Audio.png{{!}}25px]]|video|Video=[[Image:Video.png|25px]]}} '''[[Media:{{{name1}}}.ogg{{!}}{{{pipe1{{!}}{{{name1}}}}}}]]''' <span style="font-size:95%"> {{{description1}}}
{{media table
<td style="text-align:right;width:6%"><small>{{{length1}}}</small><br><small>[[:Image:{{{name1}}}.ogg|File info]]</small>}}{{#if:{{{name2|}}}|<table style="padding:4px;width:100%"><tr><td>{{#switch:{{{type2}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''[[Media:{{{name2}}}.ogg{{!}}{{{pipe2{{!}}{{{name2}}}}}}]]''' <span style="font-size:95%">{{{description2}}}
|file1=Example.ogv
<td style="text-align:right;width:6%"><small>{{{length2}}}</small><br><small>[[:Image:{{{name2}}}.ogg|File info]]</small>}}{{#if:{{{name3|}}}|<table style="padding:4px;width:100%"><tr><td>{{#switch:{{{type3}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''[[Media:{{{name3}}}.ogg{{!}}{{{pipe3{{!}}{{{name3}}}}}}]]''' <span style="font-size:95%"> {{{description3}}}
|title1=Example video
<td style="text-align:right;width:6%"><small>{{{length3}}}</small><br><small>[[:Image:{{{name3}}}.ogg|File info]]</small>}}{{#if:{{{name4|}}}|<table style="padding:4px;width:100%"><tr><td>{{#switch:{{{type4}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''[[Media:{{{name4}}}.ogg{{!}}{{{pipe4{{!}}{{{name4}}}}}}]]''' <span style="font-size:95%"> {{{description4}}}
|description1=Showing an example video file.
<td style="text-align:right;width:6%"><small>{{{length4}}}</small><br><small>[[:Image:{{{name4}}}.ogg|File info]]</small>}}{{#if:{{{name5|}}}|<table style="padding:4px;width:100%"><tr><td>{{#switch:{{{type5}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''[[Media:{{{name5}}}.ogg{{!}}{{{pipe5{{!}}{{{name5}}}}}}]]''' <span style="font-size:95%"> {{{description5}}}
|length1=0:12
<td style="text-align:right;width:6%"><small>{{{length5}}}</small><br><small>[[:Image:{{{name5}}}.ogg|File info]]</small>}}{{#if:{{{name6|}}}|<table style="padding:4px;width:100%"><tr><td>{{#switch:{{{type6}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''[[Media:{{{name6}}}.ogg{{!}}{{{pipe6{{!}}{{{name6}}}}}}]]''' <span style="font-size:95%"> {{{description6}}}
|file2=Example.oga
<td style="text-align:right;width:6%"><small>{{{length6}}}</small><br><small>[[:Image:{{{name6}}}.ogg|File info]]</small>}}{{#if:{{{name7|}}}|<table style="padding:4px;width:100%"><tr><td>{{#switch:{{{type7}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''[[Media:{{{name7}}}.ogg{{!}}{{{pipe7{{!}}{{{name7}}}}}}]]''' <span style="font-size:95%"> {{{description7}}}
|title2=Example audio
<td style="text-align:right;width:6%"><small>{{{length7}}}</small><br><small>[[:Image:{{{name7}}}.ogg|File info]]</small>}}{{#if:{{{name8|}}}|<table style="padding:4px;width:100%"><tr><td>{{#switch:{{{type8}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''[[Media:{{{name8}}}.ogg{{!}}{{{pipe8{{!}}{{{name8}}}}}}]]''' <span style="font-size:95%"> {{{description8}}}
|description2=Showing an example audio file.
<td style="text-align:right;width:6%"><small>{{{length8}}}</small><br><small>[[:Image:{{{name8}}}.ogg|File info]]</small>}}{{#if:{{{name9|}}}|<table style="padding:4px;width:100%"><tr><td>{{#switch:{{{type9}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''[[Media:{{{name9}}}.ogg{{!}}{{{pipe9{{!}}{{{name9}}}}}}]]''' <span style="font-size:95%"> {{{description9}}}
|length2=0:03
<td style="text-align:right;width:6%"><small>{{{length9}}}</small><br><small>[[:Image:{{{name9}}}.ogg|File info]]</small><}}{{#if:{{{name10|}}}|<table style="padding:4px;width:100%"><tr><td>{{#switch:{{{type10}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''[[Media:{{{name10}}}.ogg{{!}}{{{pipe10{{!}}{{{name10}}}}}}]]''' <span style="font-size:95%"> {{{description10}}}
}}
<td style="text-align:right;width:6%"><small>{{{length10}}}</small><br><small>[[:Image:{{{name10}}}.ogg|File info]]</small>}}{{#if:{{{name11|}}}|<table style="padding:4px;width:100%"><tr><td>{{#switch:{{{type11}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''[[Media:{{{name11}}}.ogg{{!}}{{{pipe11{{!}}{{{name11}}}}}}]]''' <span style="font-size:95%"> {{{description11}}}
<td style="text-align:right;width:6%"><small>{{{length11}}}</small><br><small>[[:Image:{{{name11}}}.ogg|File info]]</small>}}{{#if:{{{name12|}}}|<table style="padding:4px;width:100%"><tr><td>{{#switch:{{{type12}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''[[Media:{{{name12}}}.ogg{{!}}{{{pipe12{{!}}{{{name12}}}}}}]]''' <span style="font-size:95%"> {{{description12}}}
<td style="text-align:right;width:6%"><small>{{{length12}}}</small><br><small>[[:Image:{{{name12}}}.ogg|File info]]</small>}}{{#if:{{{name13|}}}|<table style="padding:4px;width:100%"><tr><td>{{#switch:{{{type13}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''[[Media:{{{name13}}}.ogg{{!}}{{{pipe13{{!}}{{{name13}}}}}}]]''' <span style="font-size:95%"> {{{description13}}}
<td style="text-align:right;width:6%"><small>{{{length13}}}</small><br><small>[[:Image:{{{name13}}}.ogg|File info]]</small></td></tr></table>}}
:<small>[[Wikipedia:Wikipedia:Media help|Having trouble playing?]]</small><noinclude>


1-13 files supported now. If you edit this page, be careful, it contains highly esoteric (complex) coding.
== Usage ==
This template is used for organizing media files on pages. The table above is produced by the following syntax:


[[Category:Media Templates|{{PAGENAME}}]]</noinclude>
<pre>
{{media table
|file1=Example.ogv
|title1=Example video
|description1=Showing an example video file.
|length1=0:12
|file2=Example.oga
|title2=Example audio
|description2=Showing an example audio file.
|length2=0:03
}}
</pre>
 
=== Parameters ===
The following parameters may be defined when using the template (replace <code>X</code> with a number):
 
*<code>fileX</code> - The filename, excluding the "File:" prefix. So for the file at "File:Example.oga", this parameter would be defined as "Example.oga".
*<code>titleX</code> - The title of the file that will be used in the table; automatically appears in bold.
*<code>descriptionX</code> - A short description of the file that will appear after the title.
*<code>lengthX</code> - The file duration, in M:SS format.
*<code>checkX</code> - Set to <tt>no</tt> to disable the 30-second length check ''for [[Help:Media|sound clips]]''. '''Never set this for copyrighted music!'''
 
Note that for all the values, additional files can be added to the list by incrementing the parameter number.
 
[[Category:Structural templates]]</noinclude>

Latest revision as of 18:12, December 26, 2024

Icon of a film clapperboard. Example video - Showing an example video file.
File infoMedia:Example.ogv
0:12
Icon of an audio speaker. Example audio - Showing an example audio file.
File infoMedia:Example.oga
0:03
Help:MediaHaving trouble playing?

Usage

This template is used for organizing media files on pages. The table above is produced by the following syntax:

{{media table
|file1=Example.ogv
|title1=Example video
|description1=Showing an example video file.
|length1=0:12
|file2=Example.oga
|title2=Example audio
|description2=Showing an example audio file.
|length2=0:03
}}

Parameters

The following parameters may be defined when using the template (replace X with a number):

  • fileX - The filename, excluding the "File:" prefix. So for the file at "File:Example.oga", this parameter would be defined as "Example.oga".
  • titleX - The title of the file that will be used in the table; automatically appears in bold.
  • descriptionX - A short description of the file that will appear after the title.
  • lengthX - The file duration, in M:SS format.
  • checkX - Set to no to disable the 30-second length check for sound clips. Never set this for copyrighted music!

Note that for all the values, additional files can be added to the list by incrementing the parameter number.