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
(91 intermediate revisions by 12 users not shown)
Line 1: Line 1:
<!-- BIG MESS AHEAD -- ONLY EDIT IF YOU KNOW THE CODE -->
<includeonly>{{#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}}|}}}}}}}
{{#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]]}} - {{{description2}}} <center>[[File:{{{name2}}}.{{#if:{{{caps2|}}}|OGG|ogg}}{{#if:{{{pipe2|}}}|{{!}}{{{pipe2}}}}}]]</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]]}} - {{{description3}}} <center>[[File:{{{name3}}}.{{#if:{{{caps3|}}}|OGG|ogg}}{{#if:{{{pipe3|}}}|{{!}}{{{pipe3}}}}}]]</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]]}} - {{{description4}}} <center>[[File:{{{name4}}}.{{#if:{{{caps4|}}}|OGG|ogg}}{{#if:{{{pipe4|}}}|{{!}}{{{pipe4}}}}}]]</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]]}} - {{{description5}}} <center>[[File:{{{name5}}}.{{#if:{{{caps5|}}}|OGG|ogg}}{{#if:{{{pipe5|}}}|{{!}}{{{pipe5}}}}}]]</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]]}} - {{{description6}}} <center>[[File:{{{name6}}}.{{#if:{{{caps6|}}}|OGG|ogg}}{{#if:{{{pipe6|}}}|{{!}}{{{pipe6}}}}}]]</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]]}} - {{{description7}}} <center>[[File:{{{name7}}}.{{#if:{{{caps7|}}}|OGG|ogg}}{{#if:{{{pipe7|}}}|{{!}}{{{pipe7}}}}}]]</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]]}} - {{{description8}}} <center>[[File:{{{name8}}}.{{#if:{{{caps8|}}}|OGG|ogg}}{{#if:{{{pipe8|}}}|{{!}}{{{pipe8}}}}}]]</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]]}} - {{{description9}}} <center>[[File:{{{name9}}}.{{#if:{{{caps9|}}}|OGG|ogg}}{{#if:{{{pipe9|}}}|{{!}}{{{pipe9}}}}}]]</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]]}} {{{description10}}} <center>[[File:{{{name10}}}.{{#if:{{{caps10|}}}|OGG|ogg}}{{#if:{{{pipe10|}}}|{{!}}{{{pipe10}}}}}]]</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]]}} '''[[File:{{{name11}}}.{{#if:{{{caps11|}}}|OGG|ogg}}{{#if:{{{pipe11|}}}|{{!}}{{{pipe11}}}}}]]''' <span style="font-size:95%"> {{{description11}}} </span>
}}
<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]]}} '''[[File:{{{name12}}}.{{#if:{{{caps12|}}}|OGG|ogg}}{{#if:{{{pipe12|}}}|{{!}}{{{pipe12}}}}}]]''' <span style="font-size:95%"> {{{description12}}} </span>
<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]]}} '''[[File:{{{name13}}}.{{#if:{{{caps13|}}}|OGG|ogg}}{{#if:{{{pipe13|}}}|{{!}}{{{pipe13}}}}}]]''' <span style="font-size:95%"> {{{description13}}} </span>
<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]]}} '''[[File:{{{name14}}}.{{#if:{{{caps14|}}}|OGG|ogg}}{{#if:{{{pipe14|}}}|{{!}}{{{pipe14}}}}}]]''' <span style="font-size:95%"> {{{description14}}} </span>
<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]]}} '''[[File:{{{name15}}}.{{#if:{{{caps15|}}}|OGG|ogg}}{{#if:{{{pipe15|}}}|{{!}}{{{pipe15}}}}}]]''' <span style="font-size:95%"> {{{description15}}} </span>
<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]]}} '''[[File:{{{name16}}}.{{#if:{{{caps16|}}}|OGG|ogg}}{{#if:{{{pipe16|}}}|{{!}}{{{pipe16}}}}}]]''' <span style="font-size:95%"> {{{description16}}} </span>
<td style="text-align:right;width:6%"><small>{{{length16}}}</small><br><small>[[:Image:{{{name16}}}.{{#if:{{{caps16|}}}|OGG|ogg}}|File info]]</small></td></tr></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]]}} '''[[File:{{{name17}}}.{{#if:{{{caps17|}}}|OGG|ogg}}{{#if:{{{pipe17|}}}|{{!}}{{{pipe17}}}}}]]''' <span style="font-size:95%">{{{description17}}} </span>
<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]]}} '''[[File:{{{name18}}}.{{#if:{{{caps18|}}}|OGG|ogg}}{{#if:{{{pipe18|}}}|{{!}}{{{pipe18}}}}}]]''' <span style="font-size:95%">{{{description18}}} </span>
<td style="text-align:right;width:6%"><small>{{{length17}}}</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]]}} '''[[File:{{{name19}}}.{{#if:{{{caps19|}}}|OGG|ogg}}{{#if:{{{pipe19|}}}|{{!}}{{{pipe19}}}}}]]''' <span style="font-size:95%">{{{description19}}} </span>
<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]]}} '''[[File:{{{name20}}}.{{#if:{{{caps20|}}}|OGG|ogg}}{{#if:{{{pipe20|}}}|{{!}}{{{pipe20}}}}}]]''' <span style="font-size:95%">{{{description20}}} </span>
<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.


[[Category:Media Templates|{{PAGENAME}}]]</noinclude>
Note that for all the values, additional files can be added to the list by incrementing the parameter number.
 
== Sub-template ==
*[[Template:Media table/row]]
 
[[Category:Media templates]]</noinclude>

Revision as of 11:50, January 22, 2024

Video.svg Example video - Showing an example video file.
File infoMedia:Example.ogv
0:12
Audio.svg 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.

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

Sub-template