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
 
(16 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#forargs:name|key|value|{{media table/{{#switch:{{lc:{{{type{{#var:key}}}}}}}|video=OGV|#default=OGA}}|type={{{type{{#var:key}}|}}}|name={{#var:value}}|format={{{format{{#var:key}}|}}}|pipe={{{pipe{{#var:key}}|}}}|description={{{description{{#var:key}}|}}}|length={{{length{{#var:key}}|}}}|caps={{{caps{{#var:key}}|}}}}}}}
<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}}|}}}}}}}
:<small>[[Help:Media]] • [[Wikipedia:Help:Media (audio and video)|Having trouble playing?]]</small></includeonly><noinclude>{{{{PAGENAME}}
:<small>[[Help:Media]] • [[wikipedia:Help:Media (audio and video)|Having trouble playing?]]</small></includeonly><noinclude>
|type1=video
{{media table
|name1=Example.ogv
|file1=Example.ogv
|pipe1=Example Video
|title1=Example video
|description1=Showing an example.
|description1=Showing an example video file.
|length1=0:12
|length1=0:12
|type2=audio
|file2=Example.oga
|name2=Example.oga
|title2=Example audio
|pipe2=Example Audio
|description2=Showing an example audio file.
|description2=Showing an example.
|length2=0:03
|length2=0:12
}}
}}


==Usage==
== Usage ==
The code below produces the table above.
This template is used for organizing media files on pages. The table above is produced by the following syntax:
<pre><nowiki>{{media table
 
|type1=video
<pre>
|name1=Example.ogv
{{media table
|pipe1=Example Video
|file1=Example.ogv
|description1=Showing an example.
|title1=Example video
|description1=Showing an example video file.
|length1=0:12
|length1=0:12
|type2=audio
|file2=Example.oga
|name2=Example.oga
|title2=Example audio
|pipe2=Example Audio
|description2=Showing an example audio file.
|description2=Showing an example.
|length2=0:03
|length2=0:12
}}
}}</nowiki></pre>
</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. Replace <code>X</code> with a number.
=== Parameters ===
The following parameters may be defined when using the template (replace <code>X</code> with a number):


*<code>typeX</code> - Can be set to either "audio" or "video". This parameter controls the icon displayed next to the file and how to handle the linked media.
*<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>nameX</code> - The name that the file is uploaded under, 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>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 as "Example246.ogv", and <code>pipe</code> as "Example".
*<code>descriptionX</code> - A short description of the file that will appear after the title.
*<code>descriptionX</code> - A short description of the file that will appear with it on the page.
*<code>lengthX</code> - The file duration, in M:SS format.
*<code>lengthX</code> - HH:MM:SS format. Omit zeros please.


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


==Code documentation==
== Sub-template ==
Calls {{tem|media table/OGA}} for audio files and {{tem|media table/OGV}} for video files with a [[mww:Help:Extension:ParserFunctions##switch|switch]] statement.
*[[Template:Media table/row]]


[[Category:Media templates]]</noinclude>
[[Category:Media templates]]</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