|
|
(90 intermediate revisions by 12 users not shown) |
Line 1: |
Line 1: |
| <!-- BIG MESS AHEAD -- ONLY EDIT IF YOU KNOW THE CODE --> | | <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"/> |
| {{#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=[[File:Audio.png{{!}}25px]]|video|Video=[[File:Video.png|25px]]}} '''{{#if:{{{pipe1|}}}|{{{pipe1}}}}}''' - {{{description1}}} <center>[[File:{{{name1}}}.{{#switch:{{{caps1|off}}}|=ogg|off=ogg|#default=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>[[:File:{{{name1}}}.{{#switch:{{{caps1|off}}}|=ogg|off=ogg|#default=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=[[File:Audio.png|25px]]|video|Video=[[File:Video.png|25px]]}} '''{{#if:{{{pipe2|}}}|{{{pipe2}}}}}''' - {{{description2}}} <center>[[File:{{{name2}}}.{{#switch:{{{caps2|off}}}|=ogg|off=ogg|#default=OGG}}]]</center>
| | {{media table |
| <td style="text-align:right;width:6%"><small>{{{length2}}}</small><br><small>[[:File:{{{name2}}}.{{#switch:{{{caps2|off}}}|=ogg|off=ogg|#default=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=[[File:Audio.png|25px]]|video|Video=[[File:Video.png|25px]]}} '''{{#if:{{{pipe3|}}}|{{{pipe3}}}}}''' - {{{description3}}} <center>[[File:{{{name3}}}.{{#switch:{{{caps3|off}}}|=ogg|off=ogg|#default=OGG}}]]</center>
| | |file1=Example.ogv |
| <td style="text-align:right;width:6%"><small>{{{length3}}}</small><br><small>[[:File:{{{name3}}}.{{#switch:{{{caps3|off}}}|=ogg|off=ogg|#default=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=[[File:Audio.png|25px]]|video|Video=[[File:Video.png|25px]]}} '''{{#if:{{{pipe4|}}}|{{{pipe4}}}}}''' - {{{description4}}} <center>[[File:{{{name4}}}.{{#switch:{{{caps4|off}}}|=ogg|off=ogg|#default=OGG}}]]</center>
| | |title1=Example video |
| <td style="text-align:right;width:6%"><small>{{{length4}}}</small><br><small>[[:File:{{{name4}}}.{{#switch:{{{caps4|off}}}|=ogg|off=ogg|#default=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=[[File:Audio.png|25px]]|video|Video=[[File:Video.png|25px]]}} '''{{#if:{{{pipe5|}}}|{{{pipe5}}}}}''' - {{{description5}}} <center>[[File:{{{name5}}}.{{#switch:{{{caps5|off}}}|=ogg|off=ogg|#default=OGG}}]]</center>
| | |description1=Showing an example video file. |
| <td style="text-align:right;width:6%"><small>{{{length5}}}</small><br><small>[[:File:{{{name5}}}.{{#switch:{{{caps5|off}}}|=ogg|off=ogg|#default=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=[[File:Audio.png|25px]]|video|Video=[[File:Video.png|25px]]}} '''{{#if:{{{pipe6|}}}|{{{pipe6}}}}}''' - {{{description6}}} <center>[[File:{{{name6}}}.{{#switch:{{{caps6|off}}}|=ogg|off=ogg|#default=OGG}}]]</center>
| | |length1=0:12 |
| <td style="text-align:right;width:6%"><small>{{{length6}}}</small><br><small>[[:File:{{{name6}}}.{{#switch:{{{caps6|off}}}|=ogg|off=ogg|#default=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=[[File:Audio.png|25px]]|video|Video=[[File:Video.png|25px]]}} '''{{#if:{{{pipe7|}}}|{{{pipe7}}}}}''' - {{{description7}}} <center>[[File:{{{name7}}}.{{#switch:{{{caps7|off}}}|=ogg|off=ogg|#default=OGG}}]]</center> | | |file2=Example.oga |
| <td style="text-align:right;width:6%"><small>{{{length7}}}</small><br><small>[[:File:{{{name7}}}.{{#switch:{{{caps7|off}}}|=ogg|off=ogg|#default=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=[[File:Audio.png|25px]]|video|Video=[[File:Video.png|25px]]}} '''{{#if:{{{pipe8|}}}|{{{pipe8}}}}}''' - {{{description8}}} <center>[[File:{{{name8}}}.{{#switch:{{{caps8|off}}}|=ogg|off=ogg|#default=OGG}}]]</center>
| | |title2=Example audio |
| <td style="text-align:right;width:6%"><small>{{{length8}}}</small><br><small>[[:File:{{{name8}}}.{{#switch:{{{caps8|off}}}|=ogg|off=ogg|#default=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=[[File:Audio.png|25px]]|video|Video=[[File:Video.png|25px]]}} '''{{#if:{{{pipe9|}}}|{{{pipe9}}}}}''' - {{{description9}}} <center>[[File:{{{name9}}}.{{#switch:{{{caps9|off}}}|=ogg|off=ogg|#default=OGG}}]]</center>
| | |description2=Showing an example audio file. |
| <td style="text-align:right;width:6%"><small>{{{length9}}}</small><br><small>[[:File:{{{name9}}}.{{#switch:{{{caps9|off}}}|=ogg|off=ogg|#default=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=[[File:Audio.png|25px]]|video|Video=[[File:Video.png|25px]]}} '''{{#if:{{{pipe10|}}}|{{{pipe10}}}}}''' - {{{description10}}} <center>[[File:{{{name10}}}.{{#switch:{{{caps10|off}}}|=ogg|off=ogg|#default=OGG}}]]</center>
| | |length2=0:03 |
| <td style="text-align:right;width:6%"><small>{{{length10}}}</small><br><small>[[:File:{{{name10}}}.{{#switch:{{{caps10|off}}}|=ogg|off=ogg|#default=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=[[File:Audio.png|25px]]|video|Video=[[File:Video.png|25px]]}} '''{{#if:{{{pipe11|}}}|{{{pipe11}}}}}''' - {{{description11}}} <center>[[File:{{{name11}}}.{{#switch:{{{caps11|off}}}|=ogg|off=ogg|#default=OGG}}]]</center>
| | }} |
| <td style="text-align:right;width:6%"><small>{{{length11}}}</small><br><small>[[:File:{{{name11}}}.{{#switch:{{{caps11|off}}}|=ogg|off=ogg|#default=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=[[File:Audio.png|25px]]|video|Video=[[File:Video.png|25px]]}} '''{{#if:{{{pipe12|}}}|{{{pipe12}}}}}''' - {{{description12}}} <center>[[File:{{{name12}}}.{{#switch:{{{caps12|off}}}|=ogg|off=ogg|#default=OGG}}]]</center>
| |
| <td style="text-align:right;width:6%"><small>{{{length12}}}</small><br><small>[[:File:{{{name12}}}.{{#switch:{{{caps12|off}}}|=ogg|off=ogg|#default=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=[[File:Audio.png|25px]]|video|Video=[[File:Video.png|25px]]}} '''{{#if:{{{pipe13|}}}|{{{pipe13}}}}}''' - {{{description13}}} <center>[[File:{{{name13}}}.{{#switch:{{{caps13|off}}}|=ogg|off=ogg|#default=OGG}}]]</center>
| |
| <td style="text-align:right;width:6%"><small>{{{length13}}}</small><br><small>[[:File:{{{name13}}}.{{#switch:{{{caps13|off}}}|=ogg|off=ogg|#default=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=[[File:Audio.png|25px]]|video|Video=[[File:Video.png|25px]]}} '''{{#if:{{{pipe14|}}}|{{{pipe14}}}}}''' - {{{description14}}} <center>[[File:{{{name14}}}.{{#switch:{{{caps14|off}}}|=ogg|off=ogg|#default=OGG}}]]</center>
| |
| <td style="text-align:right;width:6%"><small>{{{length14}}}</small><br><small>[[:File:{{{name14}}}.{{#switch:{{{caps14|off}}}|=ogg|off=ogg|#default=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=[[File:Audio.png|25px]]|video|Video=[[File:Video.png|25px]]}} '''{{#if:{{{pipe15|}}}|{{{pipe15}}}}}''' - {{{description15}}} <center>[[File:{{{name15}}}.{{#switch:{{{caps15|off}}}|=ogg|off=ogg|#default=OGG}}]]</center>
| |
| <td style="text-align:right;width:6%"><small>{{{length15}}}</small><br><small>[[:File:{{{name15}}}.{{#switch:{{{caps15|off}}}|=ogg|off=ogg|#default=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=[[File:Audio.png|25px]]|video|Video=[[File:Video.png|25px]]}} '''{{#if:{{{pipe16|}}}|{{{pipe16}}}}}''' - {{{description16}}} <center>[[File:{{{name16}}}.{{#switch:{{{caps16|off}}}|=ogg|off=ogg|#default=OGG}}]]</center>
| |
| <td style="text-align:right;width:6%"><small>{{{length16}}}</small><br><small>[[:File:{{{name16}}}.{{#switch:{{{caps16|off}}}|=ogg|off=ogg|#default=OGG}}|File info]]</small></table>}}{{#if:{{{name17|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black"><tr><td>{{#switch:{{{type17}}}|audio|Audio=[[File:Audio.png|25px]]|video|Video=[[File:Video.png|25px]]}} '''{{#if:{{{pipe17|}}}|{{{pipe17}}}}}''' - {{{description17}}} <center>[[File:{{{name17}}}.{{#switch:{{{caps17|off}}}|=ogg|off=ogg|#default=OGG}}]]</center>
| |
| <td style="text-align:right;width:6%"><small>{{{length17}}}</small><br><small>[[:File:{{{name17}}}.{{#switch:{{{caps17|off}}}|=ogg|off=ogg|#default=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=[[File:Audio.png|25px]]|video|Video=[[File:Video.png|25px]]}} '''{{#if:{{{pipe18|}}}|{{{pipe18}}}}}''' - {{{description18}}} <center>[[File:{{{name18}}}.{{#switch:{{{caps18|off}}}|=ogg|off=ogg|#default=OGG}}]]</center>
| |
| <td style="text-align:right;width:6%"><small>{{{length18}}}</small><br><small>[[:File:{{{name18}}}.{{#switch:{{{caps18|off}}}|=ogg|off=ogg|#default=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=[[File:Audio.png|25px]]|video|Video=[[File:Video.png|25px]]}} '''{{#if:{{{pipe19|}}}|{{{pipe19}}}}}''' - {{{description19}}} <center>[[File:{{{name19}}}.{{#switch:{{{caps19|off}}}|=ogg|off=ogg|#default=OGG}}]]</center>
| |
| <td style="text-align:right;width:6%"><small>{{{length19}}}</small><br><small>[[:File:{{{name19}}}.{{#switch:{{{caps19|off}}}|=ogg|off=ogg|#default=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=[[File:Audio.png|25px]]|video|Video=[[File:Video.png|25px]]}} '''{{#if:{{{pipe20|}}}|{{{pipe20}}}}}''' - {{{description20}}} <center>[[File:{{{name20}}}.{{#switch:{{{caps20|off}}}|=ogg|off=ogg|#default=OGG}}]]</center>
| |
| <td style="text-align:right;width:6%"><small>{{{length20}}}</small><br><small>[[:File:{{{name20}}}.{{#switch:{{{caps20|off}}}|=ogg|off=ogg|#default=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> |
|
| |
|
| *name1 - The name that the file is uploaded under. It should not include the the "File:" prefix, nor the file extension (.ogg) So for the file at "File:Example.ogg", this parameter would be defined as "Example".
| | === Parameters === |
| *type1 - Should be set to either "audio" or "video". This parameter controls the icon displayed next to the file.
| | The following parameters may be defined when using the template (replace <code>X</code> with a number): |
| *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 either left blank or set to "off". Note 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 "File: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, additional files can be added to the list by incrementing the number in the parameter. Up to twenty files can be included in one template.
| | *<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. |
| | *<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!''' |
|
| |
|
| [[Category:Media Templates|{{PAGENAME}}]]</noinclude> | | Note that for all the values, additional files can be added to the list by incrementing the parameter number. |
| | |
| | [[Category:Structural templates]]</noinclude> |