Template:Youtube: Difference between revisions

Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.
Added playlist support
m (Protected "Template:Youtube": This template is a bit too important to leave open to new accounts. ([edit=autoconfirmed] (indefinite) [move=autoconfirmed] (indefinite)))
(Added playlist support)
Line 1: Line 1:
<includeonly>{|style="margin: 0.5em; margin-top:0 !important; padding: 3px 0 3px 0 !important; margin-{{#switch:{{{3|}}}|{{Void}}=left|left=left|right=right|center=center|#default=left}}:0 !important; background-color:#F2F2F2; border: 2px solid #AAA;width:100px;float:{{#switch:{{{3|}}}|{{Void}}=left|left=left|right=right|center=center|#default=left}}"
<includeonly>{|style="margin: 0.5em; margin-top:0 !important; padding: 3px 0 3px 0 !important; margin-{{#switch:{{{3|}}}|{{Void}}=left|left=left|right=right|center=center|#default=left}}:0 !important; background-color:#F2F2F2; border: 2px solid #AAA;width:100px;float:{{#switch:{{{3|}}}|{{Void}}=left|left=left|right=right|center=center|#default=left}}"
|<div>
|<div>
|{{#widget:YouTube|id={{{1}}}|at={{{at|0}}}|width={{{2|420}}}|height={{#expr:{{{2|420}}}/1.2 round 0}}}}{{#switch:{{{3|}}}|{{Void}}={{#ifeq:{{{4|}}}|{{Void}}|{{Void}}|<br>{{{4|}}}}}|left={{#ifeq:{{{4|}}}|{{Void}}|{{Void}}|<br>{{{4|}}}}}|right={{#ifeq:{{{4|}}}|{{Void}}|{{Void}}|<br>{{{4|}}}}}|center={{#ifeq:{{{4|}}}|{{Void}}|{{Void}}|<br>{{{4|}}}}}|#default={{#ifeq:{{{3|}}}|{{Void}}|{{Void}}|<br>{{{3|}}}}}}}
|{{#widget:YouTube|{{#ifexpr:{{#len:{{{1}}}}}=11|id={{{1}}}|playlist={{{1}}}}}|at={{{at|0}}}|width={{{2|420}}}|height={{#expr:{{{2|420}}}/1.2 round 0}}}}{{#switch:{{{3|}}}|{{Void}}={{#ifeq:{{{4|}}}|{{Void}}|{{Void}}|<br>{{{4|}}}}}|left={{#ifeq:{{{4|}}}|{{Void}}|{{Void}}|<br>{{{4|}}}}}|right={{#ifeq:{{{4|}}}|{{Void}}|{{Void}}|<br>{{{4|}}}}}|center={{#ifeq:{{{4|}}}|{{Void}}|{{Void}}|<br>{{{4|}}}}}|#default={{#ifeq:{{{3|}}}|{{Void}}|{{Void}}|<br>{{{3|}}}}}}}
|</div>
|</div>
|}
|}
Line 14: Line 14:


Where:
Where:
*'''''Video Code''''' is the unique sequence of letters, numbers, and characters that point to the video.
*'''''Video Code''''' is the unique sequence of letters, numbers, and characters that point to the video. Either a single video code, which is eleven characters long, or a playlist code, which is eighteen characters long, may be used. If a playlist is used, it'll start at the first video.
*'''''Video Size''''' is the desired size of the video. Defaults to 420 pixels.
*'''''Video Size''''' is the desired size of the video. Defaults to 420 pixels.
*'''''Location''''' is where to have the video. (i.e. right, left, or center.) Defaults to left if blank.
*'''''Location''''' is where to have the video. (i.e. right, left, or center.) Defaults to left if blank.

Navigation menu