Difference between revisions of "Template:YouTubeVideo"

From Wikispooks
Jump to navigation Jump to search
m (t)
(fix margins)
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:
 
<nowiki>{{</nowiki>{{t|{{PAGENAME}}}}<br/>
 
<nowiki>{{</nowiki>{{t|{{PAGENAME}}}}<br/>
 
|{{t|code}}= Mandatory. YouTube video code<br/>
 
|{{t|code}}= Mandatory. YouTube video code<br/>
 +
|{{t|align}}= Optional. {left,right} - defaults to "right"<br/>
 
|{{t|caption}}= Optional. video caption - standard wikitext including links<br/>
 
|{{t|caption}}= Optional. video caption - standard wikitext including links<br/>
 
|{{t|width}}= Optional. video width - whole number only - ie no 'px' (default 360)<br/>
 
|{{t|width}}= Optional. video width - whole number only - ie no 'px' (default 360)<br/>
 
|{{t|height}}= Optional. video height - whole number only - ie no 'px' (default 300)<br/>
 
|{{t|height}}= Optional. video height - whole number only - ie no 'px' (default 300)<br/>
 
<nowiki>}}</nowiki>
 
<nowiki>}}</nowiki>
</noinclude><includeonly>
+
</noinclude><includeonly>{| class="wikitable" width="20%" style="float:{{#ifeq:{{{align}}}|left|left|right}}; margin: 1.0em 1.0em 1.0em 1.0em;"
{| class="wikitable" width="20%" style="float:right; margin: 1.0em 0.0em 0.8em 1.0em;"
 
 
|-
 
|-
 
|{{#widget:YouTube|{{#if:{{{width|}}}|width={{{width|}}}px}}|{{#if:{{{height|}}}|height={{{height|}}}px}}|id={{{code|}}}}}
 
|{{#widget:YouTube|{{#if:{{{width|}}}|width={{{width|}}}px}}|{{#if:{{{height|}}}|height={{{height|}}}px}}|id={{{code|}}}}}

Latest revision as of 11:34, 12 June 2019

This template is for placing a YouTube video and caption in a right-floating box.
The caption text will wrap within the box border and the borders will expand to accommodate whatever width & height are specified for the video

Usage:
{{YouTubeVideo
|code= Mandatory. YouTube video code
|align= Optional. {left,right} - defaults to "right"
|caption= Optional. video caption - standard wikitext including links
|width= Optional. video width - whole number only - ie no 'px' (default 360)
|height= Optional. video height - whole number only - ie no 'px' (default 300)
}}