Template:YouTube: Difference between revisions
Appearance
| [checked revision] | [checked revision] |
Update Tag: Reverted |
Update Tag: Manual revert |
||
| Line 2: | Line 2: | ||
== YouTube Embed Template == | == YouTube Embed Template == | ||
Embed YouTube video | Embed YouTube video. Auto-strips query parameters from ID. | ||
'''Usage:''' <code><nowiki>{{YouTube|id=VIDEO_ID|width=640|align=center|caption=Description}}</nowiki></code> | '''Usage:''' <code><nowiki>{{YouTube|id=VIDEO_ID|width=640|align=center|caption=Description}}</nowiki></code> | ||
{{TemplateData | {{TemplateData | ||
|description=Embed a YouTube video | |description=Embed a YouTube video. Paste video ID (the 11 characters after v= in YouTube URL). | ||
|params={ | |params={ | ||
"id": { | "id": { | ||
| Line 29: | Line 23: | ||
"label": "Alignment", | "label": "Alignment", | ||
"type": "string", | "type": "string", | ||
"default": "center" | "default": "center", | ||
"description": "left / center / right" | |||
}, | }, | ||
"caption": { | "caption": { | ||
| Line 35: | Line 30: | ||
"type": "string", | "type": "string", | ||
"required": false | "required": false | ||
} | } | ||
} | } | ||
| Line 46: | Line 35: | ||
[[Category:Templates]] | [[Category:Templates]] | ||
</noinclude><includeonly><div style="text-align:{{{align|center}}}; margin:10px 0;">< | </noinclude><includeonly><div style="text-align:{{{align|center}}}; margin:10px 0;"><youtube width="{{{width|640}}}" height="{{#expr: ( {{{width|640}}} * 9 / 16 ) round 0 }}">{{#explode:{{#explode:{{{id|}}}|?|0}}|&|0}}</youtube>{{#if:{{{caption|}}}|<br><em style="color:#666">{{{caption}}}</em>|}}</div></includeonly> | ||
Revision as of 03:20, 20 May 2026
YouTube Embed Template
Embed YouTube video. Auto-strips query parameters from ID.
Usage: {{YouTube|id=VIDEO_ID|width=640|align=center|caption=Description}}