User:NewSMBU/Media-OGV/Try2: Difference between revisions

From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
No edit summary
No edit summary
Line 3: Line 3:
<!-- Complex but not giant code ahead. -->
<!-- Complex but not giant code ahead. -->
{{#if:{{{name1|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black;border-top:2px solid black"><tr><td>{{#ifeq:{{lc:{{{type1}}}}}|video|[[File:Video.svg|25px]]|[[File:Video.svg|25px]]}} {{#ifeq:{{lc:{{{type1}}}}}|video|'''[[Media:{{{name1}}}.{{#switch:{{{caps1|off}}}|=ogv|off=ogv|#default=OGV}}|{{{pipe1|{{{name1}}}}}}]]'''|'''{{{pipe1|{{{name1}}}}}}'''}} {{#if:{{{description1|}}}|- {{{description1}}}}}<center>{{#ifeq:{{lc:{{{type1}}}}}|video||[[File:{{{name1}}}.{{#switch:{{{caps1|off}}}|=ogv|off=ogv|#default=OGV}}]]}}</center><td style="text-align:right;width:6%"><small>{{{length1|}}}</small><br><small>[[:File:{{{name1}}}.{{#switch:{{{caps1|off}}}|=ogv|off=ogv|#default=OGV}}|File info]]</small></table>}}<small>[[wikipedia:Wikipedia:Media help|Having trouble playing?]]</small>
{{#if:{{{name1|}}}|<table style="padding:4px;width:100%;border-collapse:collapse;border:1px solid black;border-top:2px solid black"><tr><td>{{#ifeq:{{lc:{{{type1}}}}}|video|[[File:Video.svg|25px]]|[[File:Video.svg|25px]]}} {{#ifeq:{{lc:{{{type1}}}}}|video|'''[[Media:{{{name1}}}.{{#switch:{{{caps1|off}}}|=ogv|off=ogv|#default=OGV}}|{{{pipe1|{{{name1}}}}}}]]'''|'''{{{pipe1|{{{name1}}}}}}'''}} {{#if:{{{description1|}}}|- {{{description1}}}}}<center>{{#ifeq:{{lc:{{{type1}}}}}|video||[[File:{{{name1}}}.{{#switch:{{{caps1|off}}}|=ogv|off=ogv|#default=OGV}}]]}}</center><td style="text-align:right;width:6%"><small>{{{length1|}}}</small><br><small>[[:File:{{{name1}}}.{{#switch:{{{caps1|off}}}|=ogv|off=ogv|#default=OGV}}|File info]]</small></table>}}<small>[[wikipedia:Wikipedia:Media help|Having trouble playing?]]</small>
<noinclude>==Usage==
The purpose of this template is to cleanly insert Video files into pages. The following parameters may be defined when using it.
*name1 - The name that the file is uploaded under. It should not include the the "File:" prefix, nor the file extension (.ogv) So for the file at "File:Example.ogv", this parameter would be defined as "Example".
*type1 - Should be set to either "audio" or "video". This parameter, however, is useless. No matter if it is being set to "audio", icon stays same as "video".
*caps1 - If the file extension is written in all caps (.OGV), this should be set to "on". If it is written in lowercase (.ogv), 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.ogv", 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.
At current, it supports only one file per template.

Revision as of 15:19, February 26, 2012

Second try of the media template for OGV files. This time the code is ripped off from the original Template:Media. No matter if you set to Audio, icon stays the same. Due to difficulty and laziness, this supports one file per template. So everytime you need to input the template, over and over.
Having trouble playing?

Usage

The purpose of this template is to cleanly insert Video files into pages. The following parameters may be defined when using it.

  • name1 - The name that the file is uploaded under. It should not include the the "File:" prefix, nor the file extension (.ogv) So for the file at "File:Example.ogv", this parameter would be defined as "Example".
  • type1 - Should be set to either "audio" or "video". This parameter, however, is useless. No matter if it is being set to "audio", icon stays same as "video".
  • caps1 - If the file extension is written in all caps (.OGV), this should be set to "on". If it is written in lowercase (.ogv), 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.ogv", 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.

At current, it supports only one file per template.