Template:YouTube: Difference between revisions
Jump to navigation
Jump to search
(Trying to fix alignment) |
m (Fixed hidden captions) |
||
Line 1: | Line 1: | ||
<includeonly><div style="float:left; margin: .5em 0 1.3em 1.4em;">{{#ev:youtube|{{{1}}}|300|[http://youtube.com/watch?v={{{1}}} {{#if:{{{2|}}}|{{{2}}}]|http://youtube.com/watch?v={{{1}}}]}}}}</div></includeonly><noinclude>{{documentation}}</noinclude> | <includeonly><div style="float:left; margin: .5em 0 1.3em 1.4em;">{{#ev:youtube|{{{1}}}||300|[http://youtube.com/watch?v={{{1}}} {{#if:{{{2|}}}|{{{2}}}]|http://youtube.com/watch?v={{{1}}}]}}}}</div></includeonly><noinclude>{{documentation}}</noinclude> |
Revision as of 18:45, 8 November 2012
[edit] [ ] Template documentation
This template provides a simplified way to use the EmbedVideo plugin. It automatically uses the standard thumbnail size and position used on this wiki.
Usage
The YouTube template should be called in the following way:
{{YouTube|<videoID>|<title>|<options>}}
where
Video ID
is the ID is the bold part of the URL (http://www.youtube.com/watch?v=VqNcksMfAjM)Title
(optional) is the caption for the videooptions
(optional) control some other functionalities of this template. Specifyingbr
in this parameter tell the template to create a new row after embedding the video. Specifyinglink
makes the template return only a hiperlink to watch the video on YouTube.
Examples
- Embed a video by specifying video ID and title. Titles longer than the box will automatically be truncated. We are embedding only one video, so we should add the
br
tag to the 3rd parameter. In this example,{{YouTube|VqNcksMfAjM|The Legend of Zelda: The Wind Waker Intro with caption text longer than thumbnail box size|br}}
will produce this:
EmbedVideo was given an illegal value for the alignment parameter "300". Valid values are "left", "center", "right", or "inline".
- Embed a video by specifying only video ID, so the 2nd parameter is null. We are embedding only one video, so we should add the
br
tag to the 3rd parameter. In this example,{{YouTube|VqNcksMfAjM||br}}
make the template use URL as title since no title was entered:
EmbedVideo was given an illegal value for the alignment parameter "300". Valid values are "left", "center", "right", or "inline".
- Return a hiperlink to watch the video on YouTube by specifying video ID and title. We want only the hiperlink, so we should add the
link
tag to the 3rd parameter. In this example,{{YouTube|VqNcksMfAjM|The Legend of Zelda: The Wind Waker Intro|link}}
will produce this:
- EmbedVideo was given an illegal value for the alignment parameter "300". Valid values are "left", "center", "right", or "inline".
- Return a hiperlink to watch the video on YouTube by specifying only video ID. We want only the hiperlink, so we should add the
link
tag to the 3rd parameter. In this example,{{YouTube|VqNcksMfAjM||link}}
make the template use URL as title since no title was entered:
- EmbedVideo was given an illegal value for the alignment parameter "300". Valid values are "left", "center", "right", or "inline".
Notes
- To use only video ID and an option, you must null the 2nd parameter by using ||, like this:
{{YouTube|<videoID>||<options>}}
- The 3rd parameter only accept one option. If you include more than one option, none of them will work.
- Using multiple calls will make the videos be side-by-side (the last video should ALWAYS include the
br
tag to the 3rd parameter):
EmbedVideo was given an illegal value for the alignment parameter "300". Valid values are "left", "center", "right", or "inline".
EmbedVideo was given an illegal value for the alignment parameter "300". Valid values are "left", "center", "right", or "inline".
EmbedVideo was given an illegal value for the alignment parameter "300". Valid values are "left", "center", "right", or "inline".
- When you need one video in each row, you should add the
br
tag to the 3rd parameter of all videos, not just the last:
EmbedVideo was given an illegal value for the alignment parameter "300". Valid values are "left", "center", "right", or "inline".
EmbedVideo was given an illegal value for the alignment parameter "300". Valid values are "left", "center", "right", or "inline".
EmbedVideo was given an illegal value for the alignment parameter "300". Valid values are "left", "center", "right", or "inline".
- If you use this template and forget to add the
br
tag to the 3rd parameter after calling the last video, you'll get something weird, like this topic!
The above documentation is transcluded from Template:YouTube/doc. (edit | history) Editors can experiment in this template's sandbox (edit) and testcases (create) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |