Template:YouTube: Difference between revisions
Appearance
| [checked revision] | [checked revision] |
Update Tag: Reverted |
Update |
||
| (2 intermediate revisions by the same user not shown) | |||
| 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> | |||
{{TemplateData | |||
|description=Embed a YouTube video. Paste video ID (the 11 characters after v= in YouTube URL). | |||
|params={ | |||
"id": { | |||
"label": "YouTube Video ID", | |||
"type": "string", | |||
"required": true, | |||
"description": "Video ID (11 chars). Query parameters auto-stripped." | |||
}, | |||
"width": { | |||
"label": "Width (px)", | |||
"type": "number", | |||
"default": "640" | |||
}, | |||
"align": { | |||
"label": "Alignment", | |||
"type": "string", | |||
"default": "center", | |||
"description": "left / center / right" | |||
}, | |||
"caption": { | |||
"label": "Caption", | |||
"type": "string", | |||
"required": false | |||
} | |||
} | |||
}} | |||
[[Category:Templates]] | [[Category:Templates]] | ||
</noinclude><includeonly><div | </noinclude><includeonly><div class="soji-yt-embed" data-video-id="{{#explode:{{#explode:{{{id|}}}|?|0}}|&|0}}" data-width="{{{width|640}}}" data-align="{{{align|center}}}" data-caption="{{{caption|}}}"></div></includeonly> | ||
Latest revision as of 08:27, 25 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}}