Template:YouTube: Difference between revisions

Jump to navigation Jump to search
1,261 bytes removed ,  29 September 2022
no edit summary
imported>Hb1290
(expanding for 20 videos in preparation for full implementation)
imported>Hb1290
No edit summary
Line 20: Line 20:
-->{{#if:{{{id19|}}}|{{#ev:youtube|{{{id19}}}|dimensions={{{width19|240}}}x{{{height19|185}}|inline|<center>{{{description19}}}</center>|urlArgs=start={{{t19}}}}}}}<!--
-->{{#if:{{{id19|}}}|{{#ev:youtube|{{{id19}}}|dimensions={{{width19|240}}}x{{{height19|185}}|inline|<center>{{{description19}}}</center>|urlArgs=start={{{t19}}}}}}}<!--
-->{{#if:{{{id20|}}}|{{#ev:youtube|{{{id20}}}|dimensions={{{width20|240}}}x{{{height20|185}}|inline|<center>{{{description20}}}</center>|urlArgs=start={{{t20}}}}}}}<!--
-->{{#if:{{{id20|}}}|{{#ev:youtube|{{{id20}}}|dimensions={{{width20|240}}}x{{{height20|185}}|inline|<center>{{{description20}}}</center>|urlArgs=start={{{t20}}}}}}}<!--
</center></includeonly>
</center></includeonly><noinclude>
<noinclude>
''For information on this template and its usage, see [[CLG Wiki:Tutorial Guide#Adding Videos|CLG Wiki:Tutorial Guide § Adding Videos]]''
A rewrite of the YouTube template which uses [[mw:Extension:EmbedVideo]]. The markup is unchanged by default, with the exception of the optional <code>width</code> and <code>height</code> parameters being replaced by a single <code>dimensions</code> parameter. For this parameter, input must be expressed as <code>(width) x (height)</code>. The new template also adds an optional <code>description</code> parameter which allows us to caption embedded videos in the same manner as images and directly uploaded videos (finally!). A new <code>t</code> parameter allows you to start the video at a certain timestamp, which didn't work properly with the old YouTube extension. Given EmbedVideo's broader capabilities, versions of this template can be created for Vimeo, Dailymotion, Archive.org and more.
 
Example markup:
<code><nowiki>{{YouTube2|id=yuo0EWZMTBc|description=this is the first video|id2=yuo0EWZMTBc|description2=this is the second video|id3=yuo0EWZMTBc|description3=this is the third video|id4=NYkhWaUG5d4|t4=21|description=this is a video with a timestamp (0:21)}}</nowiki></code>
 
Output (ignore the "Template Loop" message if it appears):
{{YouTube2|id=yuo0EWZMTBc|description=this is the first video|id2=yuo0EWZMTBc|description2=this is the second video|id3=yuo0EWZMTBc|description3=this is the third video|id4=NYkhWaUG5d4|t4=21|description4=this is a video with a timestamp (0:21)}}
</noinclude>
</noinclude>
Anonymous user

Navigation menu