Template:Media table: Difference between revisions

From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
No edit summary
mNo edit summary
 
(94 intermediate revisions by 12 users not shown)
Line 1: Line 1:
<!-- BIG MESS AHEAD -- ONLY EDIT IF YOU KNOW THE CODE -->
<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"/>
{{#if:{{{name1|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black;border-top:2px solid black"><tr><td>{{#switch:{{{type1}}}|audio|Audio=[[Image:Audio.png{{!}}25px]]|video|Video=[[Image:Video.png|25px]]}} '''{{#if:{{{pipe1|}}}|{{{pipe1}}}}}''' - {{{description1}}} <center>[[File:{{{name1}}}.{{#if:{{{caps1|}}}|OGG|ogg}}]]</center>
:<small>[[Help:Media]] [[wikipedia:Help:Media (audio and video)|Having trouble playing?]]</small></includeonly><noinclude>
<td style="text-align:right;width:6%"><small>{{{length1}}}</small><br><small>[[:Image:{{{name1}}}.{{#if:{{{caps1|}}}|OGG|ogg}}|File info]]</small></table>}}{{#if:{{{name2|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black"><tr><td>{{#switch:{{{type2}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''{{#if:{{{pipe2|}}}|{{{pipe2}}}}}''' - {{{description2}}} <center>[[File:{{{name2}}}.{{#if:{{{caps2|}}}|OGG|ogg}}]]</center>
{{media table
<td style="text-align:right;width:6%"><small>{{{length2}}}</small><br><small>[[:Image:{{{name2}}}.{{#if:{{{caps2|}}}|OGG|ogg}}|File info]]</small></table>}}{{#if:{{{name3|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black"><tr><td>{{#switch:{{{type3}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''{{#if:{{{pipe3|}}}|{{{pipe3}}}}}''' - {{{description3}}} <center>[[File:{{{name3}}}.{{#if:{{{caps3|}}}|OGG|ogg}}]]</center>
|file1=Example.ogv
<td style="text-align:right;width:6%"><small>{{{length3}}}</small><br><small>[[:Image:{{{name3}}}.{{#if:{{{caps3|}}}|OGG|ogg}}|File info]]</small></table>}}{{#if:{{{name4|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black"><tr><td>{{#switch:{{{type4}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''{{#if:{{{pipe4|}}}|{{{pipe4}}}}}''' - {{{description4}}} <center>[[File:{{{name4}}}.{{#if:{{{caps4|}}}|OGG|ogg}}]]</center>
|title1=Example video
<td style="text-align:right;width:6%"><small>{{{length4}}}</small><br><small>[[:Image:{{{name4}}}.{{#if:{{{caps4|}}}|OGG|ogg}}|File info]]</small></table>}}{{#if:{{{name5|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black"><tr><td>{{#switch:{{{type5}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''{{#if:{{{pipe5|}}}|{{{pipe5}}}}}''' - {{{description5}}} <center>[[File:{{{name5}}}.{{#if:{{{caps5|}}}|OGG|ogg}}]]</center>
|description1=Showing an example video file.
<td style="text-align:right;width:6%"><small>{{{length5}}}</small><br><small>[[:Image:{{{name5}}}.{{#if:{{{caps5|}}}|OGG|ogg}}|File info]]</small></table>}}{{#if:{{{name6|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black"><tr><td>{{#switch:{{{type6}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''{{#if:{{{pipe6|}}}|{{{pipe6}}}}}''' - {{{description6}}} <center>[[File:{{{name6}}}.{{#if:{{{caps6|}}}|OGG|ogg}}]]</center>
|length1=0:12
<td style="text-align:right;width:6%"><small>{{{length6}}}</small><br><small>[[:Image:{{{name6}}}.{{#if:{{{caps6|}}}|OGG|ogg}}|File info]]</small></table>}}{{#if:{{{name7|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black"><tr><td>{{#switch:{{{type7}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''{{#if:{{{pipe7|}}}|{{{pipe7}}}}}''' - {{{description7}}} <center>[[File:{{{name7}}}.{{#if:{{{caps7|}}}|OGG|ogg}}]]</center>
|file2=Example.oga
<td style="text-align:right;width:6%"><small>{{{length7}}}</small><br><small>[[:Image:{{{name7}}}.{{#if:{{{caps7|}}}|OGG|ogg}}|File info]]</small></table>}}{{#if:{{{name8|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black"><tr><td>{{#switch:{{{type8}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''{{#if:{{{pipe8|}}}|{{{pipe8}}}}}''' - {{{description8}}} <center>[[File:{{{name8}}}.{{#if:{{{caps8|}}}|OGG|ogg}}]]</center>
|title2=Example audio
<td style="text-align:right;width:6%"><small>{{{length8}}}</small><br><small>[[:Image:{{{name8}}}.{{#if:{{{caps8|}}}|OGG|ogg}}|File info]]</small></table>}}{{#if:{{{name9|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black"><tr><td>{{#switch:{{{type9}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''{{#if:{{{pipe9|}}}|{{{pipe9}}}}}''' - {{{description9}}} <center>[[File:{{{name9}}}.{{#if:{{{caps9|}}}|OGG|ogg}}]]</center>
|description2=Showing an example audio file.
<td style="text-align:right;width:6%"><small>{{{length9}}}</small><br><small>[[:Image:{{{name9}}}.{{#if:{{{caps9|}}}|OGG|ogg}}|File info]]</small></table>}}{{#if:{{{name10|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black"><tr><td>{{#switch:{{{type10}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''{{#if:{{{pipe10|}}}|{{{pipe10}}}}}''' - {{{description10}}} <center>[[File:{{{name10}}}.{{#if:{{{caps10|}}}|OGG|ogg}}]]</center>
|length2=0:03
<td style="text-align:right;width:6%"><small>{{{length10}}}</small><br><small>[[:Image:{{{name10}}}.{{#if:{{{caps10|}}}|OGG|ogg}}|File info]]</small></table>}}{{#if:{{{name11|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black"><tr><td>{{#switch:{{{type11}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''{{#if:{{{pipe11|}}}|{{{pipe11}}}}}''' - {{{description11}}} <center>[[File:{{{name11}}}.{{#if:{{{caps11|}}}|OGG|ogg}}]]</center>
}}
<td style="text-align:right;width:6%"><small>{{{length11}}}</small><br><small>[[:Image:{{{name11}}}.{{#if:{{{caps11|}}}|OGG|ogg}}|File info]]</small></table>}}{{#if:{{{name12|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black"><tr><td>{{#switch:{{{type12}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''{{#if:{{{pipe12|}}}|{{{pipe12}}}}}''' - {{{description12}}} <center>[[File:{{{name12}}}.{{#if:{{{caps12|}}}|OGG|ogg}}]]</center>
<td style="text-align:right;width:6%"><small>{{{length12}}}</small><br><small>[[:Image:{{{name12}}}.{{#if:{{{caps12|}}}|OGG|ogg}}|File info]]</small></table>}}{{#if:{{{name13|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black"><tr><td>{{#switch:{{{type13}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''{{#if:{{{pipe13|}}}|{{{pipe13}}}}}''' - {{{description13}}} <center>[[File:{{{name13}}}.{{#if:{{{caps13|}}}|OGG|ogg}}]]</center>
<td style="text-align:right;width:6%"><small>{{{length13}}}</small><br><small>[[:Image:{{{name13}}}.{{#if:{{{caps13|}}}|OGG|ogg}}|File info]]</small></table>}}{{#if:{{{name14|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black"><tr><td>{{#switch:{{{type14}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''{{#if:{{{pipe14|}}}|{{{pipe14}}}}}''' - {{{description14}}} <center>[[File:{{{name14}}}.{{#if:{{{caps14|}}}|OGG|ogg}}]]</center>
<td style="text-align:right;width:6%"><small>{{{length14}}}</small><br><small>[[:Image:{{{name14}}}.{{#if:{{{caps14|}}}|OGG|ogg}}|File info]]</small></table>}}{{#if:{{{name15|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black"><tr><td>{{#switch:{{{type15}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''{{#if:{{{pipe15|}}}|{{{pipe15}}}}}''' - {{{description15}}} <center>[[File:{{{name15}}}.{{#if:{{{caps15|}}}|OGG|ogg}}]]</center>
<td style="text-align:right;width:6%"><small>{{{length15}}}</small><br><small>[[:Image:{{{name15}}}.{{#if:{{{caps15|}}}|OGG|ogg}}|File info]]</small></table>}}{{#if:{{{name16|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black"><tr><td>{{#switch:{{{type16}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''{{#if:{{{pipe16|}}}|{{{pipe16}}}}}''' - {{{description16}}} <center>[[File:{{{name16}}}.{{#if:{{{caps16|}}}|OGG|ogg}}]]</center>
<td style="text-align:right;width:6%"><small>{{{length16}}}</small><br><small>[[:Image:{{{name16}}}.{{#if:{{{caps16|}}}|OGG|ogg}}|File info]]</small></table>}}{{#if:{{{name17|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black"><tr><td>{{#switch:{{{type17}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''{{#if:{{{pipe17|}}}|{{{pipe17}}}}}''' - {{{description17}}} <center>[[File:{{{name17}}}.{{#if:{{{caps17|}}}|OGG|ogg}}]]</center>
<td style="text-align:right;width:6%"><small>{{{length17}}}</small><br><small>[[:Image:{{{name17}}}.{{#if:{{{caps17|}}}|OGG|ogg}}|File info]]</small></table>}}{{#if:{{{name18|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black"><tr><td>{{#switch:{{{type18}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''{{#if:{{{pipe18|}}}|{{{pipe18}}}}}''' - {{{description18}}} <center>[[File:{{{name18}}}.{{#if:{{{caps18|}}}|OGG|ogg}}]]</center>
<td style="text-align:right;width:6%"><small>{{{length18}}}</small><br><small>[[:Image:{{{name18}}}.{{#if:{{{caps18|}}}|OGG|ogg}}|File info]]</small></table>}}{{#if:{{{name19|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black"><tr><td>{{#switch:{{{type19}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''{{#if:{{{pipe19|}}}|{{{pipe19}}}}}''' - {{{description19}}} <center>[[File:{{{name19}}}.{{#if:{{{caps19|}}}|OGG|ogg}}]]</center>
<td style="text-align:right;width:6%"><small>{{{length19}}}</small><br><small>[[:Image:{{{name19}}}.{{#if:{{{caps19|}}}|OGG|ogg}}|File info]]</small></table>}}{{#if:{{{name20|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black"><tr><td>{{#switch:{{{type20}}}|audio|Audio=[[Image:Audio.png|25px]]|video|Video=[[Image:Video.png|25px]]}} '''{{#if:{{{pipe20|}}}|{{{pipe20}}}}}''' - {{{description20}}} <center>[[File:{{{name20}}}.{{#if:{{{caps20|}}}|OGG|ogg}}]]</center>
<td style="text-align:right;width:6%"><small>{{{length20}}}</small><br><small>[[:Image:{{{name20}}}.{{#if:{{{caps20|}}}|OGG|ogg}}|File info]]</small></table>}}
:<small>[[Wikipedia:Wikipedia:Media help|Having trouble playing?]]</small><noinclude>


1-20 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:


==Usage==
<pre>
The purpose of this template is to cleanly insert Audio and Video files into pages. The following parameters may be defined when using it.
{{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>


*mediafor - Whatever these files pertain to. It defaults to the current article's name when not set.
=== Parameters ===
*name1 - The name that the file is uploaded under. It should not include the the "Image:" prefix, nor the file extension (.ogg) So for the file at "Image:Example.ogg", this parameter would be defined as "Example".
The following parameters may be defined when using the template (replace <code>X</code> with a number):
*type1 - Should be set to either "audio" or "video". This parameter controls the icon displayed next to the file.
*caps1 - If the file extension is written in ALL CAPS (.OGG), this should be set to "on". If it is written in lowercase (.ogg), it should be left blank. Note that it ''may not'' be set to "off". Note also that a file extension containing a mix of capitals and lowercase is incompatible with this template.
*pipe1 - This should be the file's name as it will appear on the page. For instance, if a file is uploaded at "Image:Example246.ogg", but it needs to appear on the page as simply "Example", name1 would be defined "Example246", and pipe1 "Example". In cases where name1 and pipe1 would be set to identical values, only name1 needs to be used.
*description1 - A short description of the file that will appear with it on the page.


Note that for all the values except for mediafor, additional files can be added to the list by incrementing the number in the parameter. Up to sixteen files can be included in one table.
*<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!'''


[[Category:Media Templates|{{PAGENAME}}]]</noinclude>
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.