Difference between revisions of "Template:YouTubeVideo"

From Wikispooks
Jump to navigation Jump to search
(create page)
 
(fix margins)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>This template is for placing a You Yube video and caption in a right-floating box
+
<noinclude>[[category:Box Templates]]'''This template is for placing a YouTube video and caption in a right-floating box.'''<br/>
 +
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:'''<br/>
 
'''Usage:'''<br/>
 
<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 - 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 - 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: 0em 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|}}}}}
 
|-
 
|-
 
|style="text-align:center; padding: 0.5em;" |{{{caption|}}}
 
|style="text-align:center; padding: 0.5em;" |{{{caption|}}}
|}
+
|}</includeonly>

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)
}}