Template:YouTube: Difference between revisions
MusikAnimal (talk | contribs) No edit summary |
MusikAnimal (talk | contribs) m (Protected "Template:YouTube": High traffic page ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))) |
||
(17 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<templatestyles src="Template:YouTube/styles.css" /><span style="float:{{{float|right}}}" class="video {{#if:{{{2|}}}|video-with-caption}}"> | <noinclude>{{#cargo_declare: | ||
_table = live_show_videos | |||
}}</noinclude><includeonly>{{#if:{{is live show}}|{{#cargo_store: | |||
_table = live_show_videos | |||
}}}}{{#if:{{{float|}}}||[[Category:YouTube templates with default float parameter]]}}</includeonly><templatestyles src="Template:YouTube/styles.css" /><span style="float:{{{float|right}}}; width:{{{width|400}}}px" class="video {{#if:{{{2|}}}|video-with-caption}}">{{#tag:youtube|{{{1|Do3tSdZucyA}}}|width="{{{width|400}}}"|height="{{{height|240}}}"}}{{#if:{{{2|}}}|<div class="thumbcaption">{{{2}}}</div>}}</span><noinclude>{{documentation}} | |||
<templatedata> | |||
{ | |||
"params": { | |||
"1": { | |||
"label": "YouTube video ID", | |||
"description": "This is the alphanumeric code that follows the v= in the URL of the YouTube video.", | |||
"type": "string", | |||
"required": true | |||
}, | |||
"2": { | |||
"label": "Description", | |||
"description": "Optional description to show below the video", | |||
"type": "content", | |||
"suggested": true | |||
}, | |||
"float": { | |||
"aliases": [ | |||
"position" | |||
], | |||
"label": "Position", | |||
"description": "Either 'left', 'right' or 'none'", | |||
"type": "string", | |||
"autovalue": "right", | |||
"suggested": true | |||
}, | |||
"width": { | |||
"label": "Width", | |||
"autovalue": "400", | |||
"description": "Width of the embedded video. Does not automatically scale with the height." | |||
}, | |||
"height": { | |||
"description": "Height of embedded video. Does not automatically scale with the width.", | |||
"autovalue": "240" | |||
} | |||
}, | |||
"description": "Embed a YouTube video" | |||
} | |||
</templatedata></noinclude> |
Latest revision as of 23:40, 13 June 2023
This template defines the table "live_show_videos". View table.
Use this template to embed YouTube videos.
Example usage
{{YouTube|Do3tSdZucyA}}
– whereDo3tSdZucyA
is the video ID. This by default displayed to the right.{{YouTube|Do3tSdZucyA|Description of the video}}
{{YouTube|Do3tSdZucyA|Description of the video|float=left}}
By default, videos are displayed floated to the right of the page. You can use the |float=
parameter, and with possible values left
, right
or none
. When floated to the left or right, sometimes text that follows can end up next to the video when you don't want it to. To get around this, add {{clear}}
after the template. For example:
{{YouTube|video ID|Description of the video|float=left}} {{clear}} Some other text that should be shown below the video.
The above documentation is transcluded from Template:YouTube/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |
Embed a YouTube video
Parameter | Description | Type | Status | |
---|---|---|---|---|
YouTube video ID | 1 | This is the alphanumeric code that follows the v= in the URL of the YouTube video. | String | required |
Description | 2 | Optional description to show below the video | Content | suggested |
Position | float position | Either 'left', 'right' or 'none'
| String | suggested |
Width | width | Width of the embedded video. Does not automatically scale with the height.
| Unknown | optional |
height | height | Height of embedded video. Does not automatically scale with the width.
| Unknown | optional |