Please remember that WiKirby contains spoilers, which you read at your own risk! See our general disclaimer for details.

Template:Youtube: Difference between revisions

From WiKirby, your independent source of Kirby knowledge.
Jump to navigationJump to search
m (Turns out these #switches were necessary)
(Made some optimizations. Doesn't need the 1st and 2nd switch if it isn't replaced with {{Void}} in the last one.)
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:#{{WKColor4}}; border:2px solid #{{WKColor2}}; width:100px; float:{{#switch:{{{3|}}}|{{Void}}=left|left=left|right=right|center=center|#default=left}}; display:inline-table;"
<includeonly>{|style="margin:0.5em; margin-top:0 !important; padding:3px 0 3px 0 !important; margin-{{{3|left}}}:0 !important; background-color:#{{WKColor4}}; border:2px solid #{{WKColor2}}; width:100px; float:{{{3|left}}}; display:inline-table;"
|<div>
|<div>
|{{#ev:youtube
|{{#ev:youtube
  |{{{1}}}
  |{{{1|}}}
  |{{#ifeq:{{{2|}}}|{{Void}}
  |{{{2|250}}}
  |250
  |{{{2|}}}
  }}
  }}{{#switch:{{{3|}}}
  }}{{#switch:{{{3|}}}
|{{Void}}={{#ifeq:{{{4|}}}|{{Void}}
  |left|right|center=<br/>{{{4|}}}
  |{{Void}}
  |#default=<br/>{{{3|}}}
  |<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>

Revision as of 04:12, 19 April 2021

Purpose

This template is for conveniently displaying Youtube videos on an article.

Usage

To use this template type:
{{Youtube|Video Code|Video Size|Alignment|Caption}}

Where:

  • Video Code is the unique sequence of letters, numbers, and characters that point to the video.
  • Video Size is the desired size of the video. Defaults to 300 pixels.
  • Alignment is where to have the video floating (i.e. right, left or none). Defaults to left if blank.
  • Caption is an optional caption to describe the video.
    • If location is neither left, right, nor none, then the it is assumed to be a caption and the video's location is set to "left".