Template: Video: Difference between revisions

From The Lost Media Wiki
Jump to: navigation, search
No edit summary
(i have not learned my lesson)
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Video ==
<includeonly>{{#arraydefine:layout
<pre>
  |1,2,3,4
<div class="hide">
}}<!--


{{#vardefine: perrow|{{{perrow|1}}}}}
--><div class="row">{{#vardefine:counter|1}}
 
{{#vardefine:count|1}}
 
{{#arraydefine:layout|1,2,3,4|,}}
 
</div>
<div class="row">
{{#arrayprint: layout
{{#arrayprint: layout
   |,
   |
   |@
   |@
   |{{#ifexpr: {{#var:count}} <= @
   |{{#ifexpr: @ <= {{{perrow|1}}}
     |{{VideoRow
     |{{VideoRow
         |service={{{service@|youtube}}}
         |service={{{service@|}}}
         |id={{{id@|}}}
         |id={{{id@|}}}
         |description={{{description@|}}}
         |description={{{description@|}}}
         |perrow={{{perrow|}}}
         |perrow={{{perrow|}}}
       }}
       }}<!--
    |
  }}<!--


-->{{#var:count|{{#expr: 0{{#var:count}} + 1 }}}}
-->{{#vardefine:counter
}}
    |{{#expr: {{#var:counter}} + 1 }}
</div>
  }}
</pre>
== VideoRow ==
<pre>
<div class="col-xs-12 {{#switch:{{{perrow|1}}}
  |1=col-lg-6 col-lg-offset-3
  |2=col-lg-6
  |3=col-lg-4
  |4=col-lg-3
  |#default=
}}">
{{#if: {{{service|}}}
  |{{#if: {{{id|}}}
     |
     |
{{#evt:
   }}
  |service      ={{{service|}}}
  |id          ={{{id|}}}
  |description  ={{{description|}}}
  |container    =frame
  |alignment   =center
}}
    |
  |
}}
}}
</div>
</div>
}}
</includeonly><noinclude>{{:{{FULLPAGENAME}}/doc}}</noinclude>
</pre>
== Usage ==
==== One bigger video centered ====
<pre>
{{Video
  |perrow=1
  |service1=
  |id1=
  |description1=
}}
</pre>
==== Two bigger videos full row ====
<pre>
{{Video
  |perrow=2
  |service1=
  |id1=
  |description1=
  |service2=
  |id2=
  |description2=
}}
</pre>
==== Two smaller videos centered ====
<pre>
{{Video
  |perrow=2
    |service1=
    |id1=
    |description1=
  |service2=
  |id2=
  |description2=
  |service3=
  |id3=
  |description3=
    |service4=
    |id4=
    |description4=
}}
</pre>
==== Three smaller videos full row ====
<pre>
{{Video
  |perrow=3
  |service1=
  |id1=
  |description1=
  |service2=
  |id2=
  |description2=
  |service3=
  |id3=
  |description3=
}}
</pre>
==== Four smaller videos full row ====
<pre>
{{Video
  |perrow=3
  |service1=
  |id1=
  |description1=
  |service2=
  |id2=
  |description2=
  |service3=
  |id3=value
  |description3=
  |service4=
  |id4=value
  |description4=
}}
</pre>

Revision as of 01:53, 26 March 2018


General notes

Places @ videos per row following perrow parameter value. @ can be 1,2,3 or 4.


One bigger video centered

{{Video|perrow  =1
  |service1     =
  |id1          =
  |description1 =
}}

{{#arraydefine:layout

 |1,2,3,4

}}

{{#arrayprint: layout

 |
 |@
 |Expression error: Unrecognized punctuation character "@".

}}



One smaller video centered

Use 3 per row layout with the central block filled.

{{Video|perrow  =3
  |service1     = <!-- empty -->
  |id1          = <!-- empty -->
  |description1 = <!-- empty -->
  |service2     =
  |id2          =
  |description2 =
  |urlargs2     =
  |service3     = <!-- empty -->
  |id3          = <!-- empty -->
  |description3 = <!-- empty -->
}}

{{#arraydefine:layout

 |1,2,3,4

}}

{{#arrayprint: layout

 |
 |@
 |Expression error: Unrecognized punctuation character "@".

}}


Three smaller videos full row

{{Video|perrow  =3
  |service1     =youtube
  |id1          =https://www.youtube.com/watch?v=h9RC3BuswEE
  |description1 =A promo featuring Joey from ''Yu-Gi-Oh''.
  |service2     =youtube
  |id2          =https://www.youtube.com/watch?v=M1P7bY20gms
  |description2 =A more general promo featuring characters from ''Jackie Chan Adventures''.
  |service3     =youtube
  |id3          =https://www.youtube.com/watch?v=hUrAFQ-y-jU
  |description3 =The previous promo but slightly extended.
}}

{{#arraydefine:layout

 |1,2,3,4

}}

{{#arrayprint: layout

 |
 |@
 |Expression error: Unrecognized punctuation character "@".

}}


Four smaller videos full row

{{Video|perrow  =4
  |service1     =youtube
  |id1          =https://www.youtube.com/watch?v=h9RC3BuswEE
  |description1 =A promo featuring Joey from ''Yu-Gi-Oh''.
  |service2     =youtube
  |id2          =https://www.youtube.com/watch?v=M1P7bY20gms
  |description2 =A more general promo featuring characters from ''Jackie Chan Adventures''.
  |service3     =youtube
  |id3          =https://www.youtube.com/watch?v=hUrAFQ-y-jU
  |description3 =The previous promo but slightly extended.
  |service4     =youtube
  |id4          =https://www.youtube.com/watch?v=Fu0SLgQg8eI
  |description4 =A promo featuring Ash Ketchum from ''Pokemon''.
}}

{{#arraydefine:layout

 |1,2,3,4

}}

{{#arrayprint: layout

 |
 |@
 |Expression error: Unrecognized punctuation character "@".

}}


To make video smaller, adjust the parent div.

Two smaller videos centered

Use 4 per row layout with two central blocks filled.

{{Video|perrow  =4
  |service1     =
  |id1          =
  |description1 =
  |service2     =youtube
  |id2          =https://www.youtube.com/watch?v=M1P7bY20gms
  |description2 =A more general promo featuring characters from ''Jackie Chan Adventures''.
  |service3     =youtube
  |id3          =https://www.youtube.com/watch?v=hUrAFQ-y-jU
  |description3 =The previous promo but slightly extended.
  |service4     =
  |id4          =
  |description4 =
}}

{{#arraydefine:layout

 |1,2,3,4

}}

{{#arrayprint: layout

 |
 |@
 |Expression error: Unrecognized punctuation character "@".

}}



Two bigger videos full row

{{Video|perrow  =2
  |service1     =youtube
  |id1          =https://www.youtube.com/watch?v=h9RC3BuswEE
  |description1 =A promo featuring Joey from ''Yu-Gi-Oh''.
  |service2     =youtube
  |id2          =https://www.youtube.com/watch?v=M1P7bY20gms
  |description2 =A more general promo featuring characters from ''Jackie Chan Adventures''.
}}

{{#arraydefine:layout

 |1,2,3,4

}}

{{#arrayprint: layout

 |
 |@
 |Expression error: Unrecognized punctuation character "@".

}}


Several rows

Just place more instances of the template...

{{#arraydefine:layout

 |1,2,3,4

}}

{{#arrayprint: layout

 |
 |@
 |Expression error: Unrecognized punctuation character "@".

}}

{{#arraydefine:layout

 |1,2,3,4

}}

{{#arrayprint: layout

 |
 |@
 |Expression error: Unrecognized punctuation character "@".

}}


Inverted

{{#arraydefine:layout

 |1,2,3,4

}}

{{#arrayprint: layout

 |
 |@
 |Expression error: Unrecognized punctuation character "@".

}}


Use empty containers for arbitrary text

Fill description only, leaving service and id empty.

{{#arraydefine:layout

 |1,2,3,4

}}

{{#arrayprint: layout

 |
 |@
 |Expression error: Unrecognized punctuation character "@".

}}


{{#arraydefine:layout

 |1,2,3,4

}}

{{#arrayprint: layout

 |
 |@
 |Expression error: Unrecognized punctuation character "@".

}}