Difference between revisions of "Template:Videos"

From MansonWiki, the Marilyn Manson encyclopedia
Jump to: navigation, search
(one more try)
Line 5: Line 5:
 
{{#forargs: | K | V |
 
{{#forargs: | K | V |
  
   <!-- if no value is specified, then wiki moves the key to the value, and the key becomes a natural number starting from 1 and so forth -- so it's NOT an empty string -->
+
   <!-- if no value is specified, then wiki moves the key to the value, and the key becomes a natural number starting from 1 and so forth -- so it's NOT an empty string... no parseInt() or so -- then stupid switch supporting up to 99 untitled videos, because MediaWiki does not provide a way. we assume if the length of the key is 1 or 2 then it's an auto-generated key like 1 or 14 or so -->
   {{#ifeq: {{#expr: {{#var: K}} }} | 1 | {{#vardefine: K | {{#var: V}} }} {{#vardefine: V |}} }}
+
   {{#switch: {{#len: {{#expr: {{#var: K}} }}
 +
  | 1 = {{#vardefine: K | {{#var: V}} }} {{#vardefine: V |}}
 +
  | 2 = {{#vardefine: K | {{#var: V}} }} {{#vardefine: V |}}
 +
  }}
  
 
   {{#ifeq: {{#expr: {{#var:column}} mod {{#var:max_columns}} }} | 0 | <tr> }}
 
   {{#ifeq: {{#expr: {{#var:column}} mod {{#var:max_columns}} }} | 0 | <tr> }}
  
 
   <td>
 
   <td>
    <p>{{#var: K}} -&gt; {{#var: V}}</p>
 
 
     <div style="background-color: #E2E2E2; padding: 6px; text-align: center;">{{#var: V}}</div>
 
     <div style="background-color: #E2E2E2; padding: 6px; text-align: center;">{{#var: V}}</div>
 
     <div style="text-align: center;">
 
     <div style="text-align: center;">

Revision as of 19:01, 18 May 2014


{{#forargs: | K | V |

Sample usage:

{{Videos
| moH2IHWOZXs = "[[The Last Day on Earth]]"
| vimeo:56060581 = "The Last Day on Earth"
}}