Template:YouTube: Difference between revisions
Appearance
| [checked revision] | [checked revision] |
Create template |
Update |
||
| Line 53: | Line 53: | ||
[[Category:Templates]] | [[Category:Templates]] | ||
< | <includeonly><div style="text-align:{{{align|center}}};"> | ||
<youtube width="{{{width|640}}}" height="{{#expr: {{{width|640}}} * 9 / 16 round 0}}">{{#explode:{{#explode:{{{id|}}}|?|0}}|&|0}}</youtube> | |||
{{#if:{{{caption|}}}|<br><em>{{{caption}}}</em>|}} | |||
</div></includeonly> | |||
Revision as of 08:18, 19 May 2026
YouTube Embed Template
Embed YouTube video easily in VisualEditor and Source Editor.
Usage: {{YouTube|id=dQw4w9WgXcQ|width=640|align=center|caption=Installation tutorial}}
Parameters:
- id (required) — YouTube video ID (the part after
v=in URL) - width (optional) — Player width in px, default 640
- align (optional) — left / center / right / inline, default center
- caption (optional) — Description text shown below video
Example with all params:
{{YouTube
| id = dQw4w9WgXcQ
| width = 640
| align = center
| caption = Installation tutorial for LIGO MAX
}}