Template:Media table: Difference between revisions

From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
No edit summary
No edit summary
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}}|}}}|title={{{title{{#var:key}}|{{{pipe{{#var:key}}|}}}}}}|description={{{description{{#var:key}}|}}}|length={{{length{{#var:key}}|}}}|caps={{{caps{{#var:key}}|}}}}}}}
<includeonly>{{#forargs:type|key|value|{{media table/{{#switch:{{lc:{{#var:value}}}}|video=OGV|#default=OGA}}|type={{#var:value}}|file={{{file{{#var:key}}|{{{name{{#var:key}}|}}}}}}|format={{{format{{#var:key}}|}}}|title={{{title{{#var:key}}|{{{pipe{{#var:key}}|}}}}}}|description={{{description{{#var:key}}|}}}|length={{{length{{#var:key}}|}}}|caps={{{caps{{#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>{{{{PAGENAME}}
|type1=video
|type1=video
|name1=Example.ogv
|file1=Example.ogv
|title1=Example Video
|title1=Example Video
|description1=Showing an example.
|description1=Showing an example.
|length1=0:12
|length1=0:12
|type2=audio
|type2=audio
|name2=Example.oga
|file2=Example.oga
|title2=Example Audio
|title2=Example Audio
|description2=Showing an example.
|description2=Showing an example.
Line 17: Line 17:
<pre><nowiki>{{media table
<pre><nowiki>{{media table
|type1=video
|type1=video
|name1=Example.ogv
|file1=Example.ogv
|title1=Example Video
|title1=Example Video
|description1=Showing an example.
|description1=Showing an example.
|length1=0:12
|length1=0:12
|type2=audio
|type2=audio
|name2=Example.oga
|file2=Example.oga
|title2=Example Audio
|title2=Example Audio
|description2=Showing an example.
|description2=Showing an example.
Line 31: Line 31:


*<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>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>nameX</code> - The filename that the file is uploaded as, excluding the "File:" prefix. So for the file at "File:Example.oga", this parameter would be defined as "Example.oga".
*<code>fileX</code> - The filename that the file is uploaded as, 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 for the file 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>title</code> as "Example".
*<code>titleX</code> - The title for the file 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>file</code> would be defined as "Example246.ogv", and <code>title</code> as "Example".
*<code>descriptionX</code> - A short description of the file that will appear with it on the page.
*<code>descriptionX</code> - A short description of the file that will appear with it on the page.
*<code>lengthX</code> - HH:MM:SS format. Omit zeros please.
*<code>lengthX</code> - HH:MM:SS format. Omit zeros please.

Revision as of 23:38, May 12, 2021

Template:Media table/OGVTemplate:Media table/OGA

Help:MediaHaving trouble playing?

Usage

The code below produces the table above.

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

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 X with a number.

  • typeX - 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.
  • fileX - The filename that the file is uploaded as, excluding the "File:" prefix. So for the file at "File:Example.oga", this parameter would be defined as "Example.oga".
  • titleX - The title for the file 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", file would be defined as "Example246.ogv", and title as "Example".
  • descriptionX - A short description of the file that will appear with it on the page.
  • lengthX - 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.

Code documentation

Calls {{media table/OGA}} for audio files and {{media table/OGV}} for video files with a switch statement.