Template:Media table: Difference between revisions
From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
m (O_o and I thought template wikipedia had lots of coding.) |
(Since not all the commands are obvious, I wrote a short "usage guide." Please feel free to fix or delete if it's unnecessary. Also added a command to override "pagename." Hopefully, nothing's broken.) |
||
Line 1: | Line 1: | ||
<br clear="all"> | <br clear="all"> | ||
<table style="padding:4px;width:100%;text-align:center;border-collapse:collapse;border-bottom:2px solid black"><tr><td>{{SITENAME}} has {{#if:{{{name2|}}}||a}} media file{{#if:{{{name2|}}}|s}} for ''{{PAGENAME}}''.<br>To view the audio or video, click the name of the file. Details for each file succeed the link.</td></tr></table> | <table style="padding:4px;width:100%;text-align:center;border-collapse:collapse;border-bottom:2px solid black"><tr><td>{{SITENAME}} has {{#if:{{{name2|}}}||a}} media file{{#if:{{{name2|}}}|s}} for ''{{{mediafor|{{PAGENAME}}}}}''.<br>To view the audio or video, click the name of the file. Details for each file succeed the link.</td></tr></table> | ||
<!-- BIG MESS AHEAD -- ONLY EDIT IF YOU KNOW THE CODE --> | <!-- BIG MESS AHEAD -- ONLY EDIT IF YOU KNOW THE CODE --> | ||
{{#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=[[Image:Audio.png{{!}}25px]]|video|Video=[[Image:Video.png|25px]]}} '''[[Media:{{{name1}}}.{{#if:{{{caps1|}}}|OGG|ogg}}{{#if:{{{pipe1|}}}|{{!}}{{{pipe1}}}}}]]''' <span style="font-size:95%"> {{{description1}}} </span> | {{#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=[[Image:Audio.png{{!}}25px]]|video|Video=[[Image:Video.png|25px]]}} '''[[Media:{{{name1}}}.{{#if:{{{caps1|}}}|OGG|ogg}}{{#if:{{{pipe1|}}}|{{!}}{{{pipe1}}}}}]]''' <span style="font-size:95%"> {{{description1}}} </span> | ||
Line 22: | Line 22: | ||
1-16 files supported now. If you edit this page, be careful, it contains highly esoteric (complex) coding. | 1-16 files supported now. If you edit this page, be careful, it contains highly esoteric (complex) coding. | ||
==Usage== | |||
The purpose of this template is to cleanly insert Audio and Video files into pages. The following parameters may be defined when using it. | |||
*mediafor - Whatever these files pertain to. It defaults to the current article's name when not set. | |||
*name1 - The name that the file is uploaded under. It should not include the the "Image:" prefix, nor the file extension (.ogg) So for the file at "Image:Example.ogg", this parameter would be defined as "Example". | |||
*type1 - Should be set to either "audio" or "video". This parameter controls the icon displayed next to the file. | |||
*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 left blank. Note that it ''may not'' be set to "off". Note also 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 "Image: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 except for mediafor, additional files can be added to the list by incrementing the number in the parameter. Up to sixteen files can be included in one table. | |||
[[Category:Media Templates|{{PAGENAME}}]]</noinclude> | [[Category:Media Templates|{{PAGENAME}}]]</noinclude> |
Revision as of 22:57, March 4, 2009
Super Mario Wiki has a media file for Media table. To view the audio or video, click the name of the file. Details for each file succeed the link. |
1-16 files supported now. If you edit this page, be careful, it contains highly esoteric (complex) coding.
Usage
The purpose of this template is to cleanly insert Audio and Video files into pages. The following parameters may be defined when using it.
- mediafor - Whatever these files pertain to. It defaults to the current article's name when not set.
- name1 - The name that the file is uploaded under. It should not include the the "Image:" prefix, nor the file extension (.ogg) So for the file at "Image:Example.ogg", this parameter would be defined as "Example".
- type1 - Should be set to either "audio" or "video". This parameter controls the icon displayed next to the file.
- 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 left blank. Note that it may not be set to "off". Note also 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 "Image: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 except for mediafor, additional files can be added to the list by incrementing the number in the parameter. Up to sixteen files can be included in one table.