Template:Media table: Difference between revisions

From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
m (Better documentation.)
mNo edit summary
 
(34 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<includeonly>{{#if:{{{name1|}}}|{{Media/{{#switch:{{lc:{{{type1}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type1|}}}|name={{{name1|}}}|pipe={{{pipe1|}}}|description={{{description1|}}}|length={{{length1|}}}|caps={{{caps1|}}}}}|}}<!--
<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:{{{name2|}}}|{{Media/{{#switch:{{lc:{{{type2}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type2|}}}|name={{{name2|}}}|pipe={{{pipe2|}}}|description={{{description2|}}}|length={{{length2|}}}|caps={{{caps2|}}}}}|}}<!--
:<small>[[Help:Media]] • [[wikipedia:Help:Media (audio and video)|Having trouble playing?]]</small></includeonly><noinclude>
-->{{#if:{{{name3|}}}|{{Media/{{#switch:{{lc:{{{type3}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type3|}}}|name={{{name3|}}}|pipe={{{pipe3|}}}|description={{{description3|}}}|length={{{length3|}}}|caps={{{caps3|}}}}}|}}<!--
{{media table
-->{{#if:{{{name4|}}}|{{Media/{{#switch:{{lc:{{{type4}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type4|}}}|name={{{name4|}}}|pipe={{{pipe4|}}}|description={{{description4|}}}|length={{{length4|}}}|caps={{{caps4|}}}}}|}}<!--
|file1=Example.ogv
-->{{#if:{{{name5|}}}|{{Media/{{#switch:{{lc:{{{type5}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type5|}}}|name={{{name5|}}}|pipe={{{pipe5|}}}|description={{{description5|}}}|length={{{length5|}}}|caps={{{caps5|}}}}}|}}<!--
|title1=Example video
-->{{#if:{{{name6|}}}|{{Media/{{#switch:{{lc:{{{type6}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type6|}}}|name={{{name6|}}}|pipe={{{pipe6|}}}|description={{{description6|}}}|length={{{length6|}}}|caps={{{caps6|}}}}}|}}<!--
|description1=Showing an example video file.
-->{{#if:{{{name7|}}}|{{Media/{{#switch:{{lc:{{{type7}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type7|}}}|name={{{name7|}}}|pipe={{{pipe7|}}}|description={{{description7|}}}|length={{{length7|}}}|caps={{{caps7|}}}}}|}}<!--
-->{{#if:{{{name8|}}}|{{Media/{{#switch:{{lc:{{{type8}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type8|}}}|name={{{name8|}}}|pipe={{{pipe8|}}}|description={{{description8|}}}|length={{{length8|}}}|caps={{{caps8|}}}}}|}}<!--
-->{{#if:{{{name9|}}}|{{Media/{{#switch:{{lc:{{{type9}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type9|}}}|name={{{name9|}}}|pipe={{{pipe9|}}}|description={{{description9|}}}|length={{{length9|}}}|caps={{{caps9|}}}}}|}}<!--
-->{{#if:{{{name10|}}}|{{Media/{{#switch:{{lc:{{{type10}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type10|}}}|name={{{name10|}}}|pipe={{{pipe10|}}}|description={{{description10|}}}|length={{{length10|}}}|caps={{{caps10|}}}}}|}}<!--
-->{{#if:{{{name11|}}}|{{Media/{{#switch:{{lc:{{{type11}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type11|}}}|name={{{name11|}}}|pipe={{{pipe11|}}}|description={{{description11|}}}|length={{{length11|}}}|caps={{{caps11|}}}}}|}}<!--
-->{{#if:{{{name12|}}}|{{Media/{{#switch:{{lc:{{{type12}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type12|}}}|name={{{name12|}}}|pipe={{{pipe12|}}}|description={{{description12|}}}|length={{{length12|}}}|caps={{{caps12|}}}}}|}}<!--
-->{{#if:{{{name13|}}}|{{Media/{{#switch:{{lc:{{{type13}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type13|}}}|name={{{name13|}}}|pipe={{{pipe13|}}}|description={{{description13|}}}|length={{{length13|}}}|caps={{{caps13|}}}}}|}}<!--
-->{{#if:{{{name14|}}}|{{Media/{{#switch:{{lc:{{{type14}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type14|}}}|name={{{name14|}}}|pipe={{{pipe14|}}}|description={{{description14|}}}|length={{{length14|}}}|caps={{{caps14|}}}}}|}}<!--
-->{{#if:{{{name15|}}}|{{Media/{{#switch:{{lc:{{{type15}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type15|}}}|name={{{name15|}}}|pipe={{{pipe15|}}}|description={{{description15|}}}|length={{{length15|}}}|caps={{{caps15|}}}}}|}}<!--
-->{{#if:{{{name16|}}}|{{Media/{{#switch:{{lc:{{{type16}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type16|}}}|name={{{name16|}}}|pipe={{{pipe16|}}}|description={{{description16|}}}|length={{{length16|}}}|caps={{{caps16|}}}}}|}}<!--
-->{{#if:{{{name17|}}}|{{Media/{{#switch:{{lc:{{{type17}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type17|}}}|name={{{name17|}}}|pipe={{{pipe17|}}}|description={{{description17|}}}|length={{{length17|}}}|caps={{{caps17|}}}}}|}}<!--
-->{{#if:{{{name18|}}}|{{Media/{{#switch:{{lc:{{{type18}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type18|}}}|name={{{name18|}}}|pipe={{{pipe18|}}}|description={{{description18|}}}|length={{{length18|}}}|caps={{{caps18|}}}}}|}}<!--
-->{{#if:{{{name19|}}}|{{Media/{{#switch:{{lc:{{{type19}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type19|}}}|name={{{name19|}}}|pipe={{{pipe19|}}}|description={{{description19|}}}|length={{{length19|}}}|caps={{{caps19|}}}}}|}}<!--
-->{{#if:{{{name20|}}}|{{Media/{{#switch:{{lc:{{{type20}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type20|}}}|name={{{name20|}}}|pipe={{{pipe20|}}}|description={{{description20|}}}|length={{{length20|}}}|caps={{{caps20|}}}}}|}}<!--
-->{{#if:{{{name21|}}}|{{Media/{{#switch:{{lc:{{{type21}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type21|}}}|name={{{name21|}}}|pipe={{{pipe21|}}}|description={{{description21|}}}|length={{{length21|}}}|caps={{{caps21|}}}}}|}}<!--
-->{{#if:{{{name22|}}}|{{Media/{{#switch:{{lc:{{{type22}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type22|}}}|name={{{name22|}}}|pipe={{{pipe22|}}}|description={{{description22|}}}|length={{{length22|}}}|caps={{{caps22|}}}}}|}}<!--
-->{{#if:{{{name23|}}}|{{Media/{{#switch:{{lc:{{{type23}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type23|}}}|name={{{name23|}}}|pipe={{{pipe23|}}}|description={{{description23|}}}|length={{{length23|}}}|caps={{{caps23|}}}}}|}}<!--
-->{{#if:{{{name24|}}}|{{Media/{{#switch:{{lc:{{{type24}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type24|}}}|name={{{name24|}}}|pipe={{{pipe24|}}}|description={{{description24|}}}|length={{{length24|}}}|caps={{{caps24|}}}}}|}}<!--
-->{{#if:{{{name25|}}}|{{Media/{{#switch:{{lc:{{{type25}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type25|}}}|name={{{name25|}}}|pipe={{{pipe25|}}}|description={{{description25|}}}|length={{{length25|}}}|caps={{{caps25|}}}}}|}}<!--
-->{{#if:{{{name26|}}}|{{Media/{{#switch:{{lc:{{{type26}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type26|}}}|name={{{name26|}}}|pipe={{{pipe26|}}}|description={{{description26|}}}|length={{{length26|}}}|caps={{{caps26|}}}}}|}}<!--
-->{{#if:{{{name27|}}}|{{Media/{{#switch:{{lc:{{{type27}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type27|}}}|name={{{name27|}}}|pipe={{{pipe27|}}}|description={{{description27|}}}|length={{{length27|}}}|caps={{{caps27|}}}}}|}}<!--
-->{{#if:{{{name28|}}}|{{Media/{{#switch:{{lc:{{{type28}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type28|}}}|name={{{name28|}}}|pipe={{{pipe28|}}}|description={{{description28|}}}|length={{{length28|}}}|caps={{{caps28|}}}}}|}}<!--
-->{{#if:{{{name29|}}}|{{Media/{{#switch:{{lc:{{{type29}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type29|}}}|name={{{name29|}}}|pipe={{{pipe29|}}}|description={{{description29|}}}|length={{{length29|}}}|caps={{{caps29|}}}}}|}}<!--
-->{{#if:{{{name30|}}}|{{Media/{{#switch:{{lc:{{{type30}}}}}|video=OGV|audio=OGA|#default=row}}|type={{{type30|}}}|name={{{name30|}}}|pipe={{{pipe30|}}}|description={{{description30|}}}|length={{{length30|}}}|caps={{{caps30|}}}}}|}}
:<small>[[wikipedia:Wikipedia:Media help|Having trouble playing?]]</small></includeonly><noinclude>{{{{PAGENAME}}
|type1=video
|name1=Example
|pipe1=Example Video
|description1=Showing an example.
|length1=0:12
|length1=0:12
|type2=audio
|file2=Example.oga
|name2=Example
|title2=Example audio
|pipe2=Example Audio
|description2=Showing an example audio file.
|description2=Showing an example.
|length2=0:03
|length2=0:12
|name3=Example
|pipe3=Example Media
|description3=Showing an example.
|length3=0:12
}}
}}


==Usage==
== Usage ==
The purpose of this template is to cleanly insert up to 30 audio and video files into pages. The following parameters may be defined when using it. Replace <code>X</code> with a number between 1-30.
This template is used for organizing media files on pages. The table above is produced by the following syntax:


*<code>typeX</code> - Should be set to either "audio" or "video", but can be ignored. However, it shouldn't because of [[MarioWiki:Proposals/Archive 47#Discourage OGG Extension (Not Format)|a proposal]]. See [[Help:Media]]. This parameter controls the icon displayed next to the file and how to handle the linked media.
<pre>
*<code>nameX</code> - The name that the file is uploaded under. It should omit the "File:" prefix and file extension (.ogg, .ogv, .oga). So for the file at "File:Example.ogv", this parameter would be defined as "Example".
{{media table
*<code>pipeX</code> - This should be the file's name as it will appear on the page. For instance, if a file is uploaded at "File:Example246.ogv", but it needs to appear on the page as simply "Example", <code>name</code> would be defined "Example246", and <code>pipe</code> "Example". In cases where <code>name</code> and <code>pipe</code> would be set to identical values, only <code>name</code> needs to be used.
|file1=Example.ogv
*<code>descriptionX</code> - A short description of the file that will appear with it on the page.
|title1=Example video
*<code>lengthX</code> - HH:MM:SS format. Omit zeros please.
|description1=Showing an example video file.
*<code>capsX</code> - If the file extension is written in all caps (.OGG, .OGV, .OGA), this should be set to "on". If it is written in lowercase (.ogg, .ogv, .oga), it should be either left blank or set to "off". Note that a file extension containing a mix of capitals and lowercase is incompatible with this template.
|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.
 
Note that for all the values, additional files can be added to the list by incrementing the parameter number.


Note that for all the values, additional files can be added to the list by incrementing the number in the parameter. Up to thirty files can be included in one template.
== Sub-template ==
*[[Template:Media table/row]]


==Code documentation==
[[Category:Media templates]]</noinclude>
Calls {{tem|media/row}}, {{tem|media/OGV}}, and {{tem|media/OGA}} with a [[mediawiki.org:Help:Extension:ParserFunctions##switch|switch]].
[[Category:Media templates|{{PAGENAME}}]]</noinclude>

Latest 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