Template:Media table: Difference between revisions

From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
mNo edit summary
mNo edit summary
 
(169 intermediate revisions by 17 users not shown)
Line 1: Line 1:
:The {{SITENAME}} has audio and/or video files for ''{{PAGENAME}}'':
<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"/>
:{| width="92%" border="1" style="border:1px solid black; background:#FCFDFF" cellpadding="4" cellspacing="0"
:<small>[[Help:Media]] • [[wikipedia:Help:Media (audio and video)|Having trouble playing?]]</small></includeonly><noinclude>
|- style="background:#ABCDEF;"
{{media table
! align="left" width="1%"|
|file1=Example.ogv
! align="left" width="23%"|{{{type1}}}
|title1=Example video
! align="left" width="23%"|{{{type2}}}
|description1=Showing an example video file.
! align="left" width="23%"|{{{type3}}}
|length1=0:12
! align="left" width="23%"|{{{type4}}}
|file2=Example.oga
|-
|title2=Example audio
|rowspan="1" style="background:#ABCDF7; vertical-align:center;" | [[Image:Sound{{{image|check}}}.png|65px]]
|description2=Showing an example audio file.
| style="vertical-align:top;" | '''{{{link1}}}'''<br>
|length2=0:03
{{{description1}}}<br>
}}
<small>{{{file1}}}</small>
| style="vertical-align:top;" | '''{{{link2}}}'''<br>
{{{description2}}}<br>
<small>{{{file2}}}</small>
| style="vertical-align:top;" | '''{{{link3}}}'''<br>
{{{description3}}}<br>
<small>{{{file3}}}</small>
| style="vertical-align:top;" | '''{{{link4}}}'''<br>
{{{description4}}}<br>
<small>{{{file4}}}</small>
|}<noinclude>


The original template has room for four files by default (a normal-size for a major article).
== Usage ==
This template is used for organizing media files on pages. The table above is produced by the following syntax:


If there is not four media links (which will be common), please fill in for ''the first vacant spot'':
<pre>
*Type: <tt><nowiki><span class="plainlinks">[{{SERVER}}{{localurl:{{PAGENAME}}|action=edit}} Add a file]</span></nowiki></tt>
{{media table
*Media: <tt><nowiki>[[Special:Upload|Upload a new file]]</nowiki></tt>
|file1=Example.ogv
*Description: N/A
|title1=Example video
*File: Nothing
|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>


Note that the file doesn't have to be internal. Barring copyright issues, external files can be added, at which case the file variable can contain <tt>N/A (external)</tt>.
=== Parameters ===
The following parameters may be defined when using the template (replace <code>X</code> with a number):


<big>See Also</big>
*<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".
*{{tem|media-single}}
*<code>titleX</code> - The title of the file that will be used in the table; automatically appears in bold.
*{{tem|media-double}}
*<code>descriptionX</code> - A short description of the file that will appear after the title.
*{{tem|media-multiple}}</noinclude>
*<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!'''
 
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.