Template:YouTube
This template should be used to embed YouTube videos.
Usage
{{Youtube | 1 = Video ID | 2 = Width (defaults to 425) | 3 = Height (defaults to width ÷ (16÷9) rounded to the nearest integer) | align = Alignment | caption = Caption | nocat = Prevents category to be added }}
- Using this template on a page categorizes the page into Category:Pages with YouTube videos unless
|nocat=
is used.
Parameters
This template adds a video that can be embedded on a page directly instead on needing to upload it directly to the wiki.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Video ID | 1 | The video ID that must be added. | String | suggested |
Video width | 2 | Changes the width of the video. Defaults to 425 | String | optional |
Video height | 3 | Changes the height of the video. Defaults to width ÷ (16÷9) rounded to the nearest integer | String | optional |
Video alignment | align | Changes the alignment of the video. | String | optional |
Video caption | caption | Adds an optional caption for the video. | String | optional |
Category supressor | nocat | Prevents [[:Category:Pages with YouTube videos]] to be added to a page using this template. | String | optional |
Examples
- Default usage
{{yt|MmB9b5njVbA}}
- Custom width
{{yt|MmB9b5njVbA|720}}
- Custom width and height
{{yt|MmB9b5njVbA|560|280}}
- Inline alignment
{{yt|MmB9b5njVbA|align=inline}} {{yt|MmB9b5njVbA|align=inline}}
- Custom caption
{{yt|MmB9b5njVbA|caption=''Minecraft'' official trailer.}}
- With an image frame
Sometimes it makes sense to put the video in an image frame so that it formats like an image:
{{FakeImage|{{yt|MmB9b5njVbA}}|Minecraft Trailer from 2011|align=right}}
This can unclutter the pages a lot. You also get to add a caption.
See also
{{YouTubeLink}}
– to link to a video, rather than embed it{{YouTube playlist}}
– to embed a playlist{{CollapsedVideo}}
– to put an embedded video in a collapsed table that links to YouTube{{Vimeo}}
– to post a video from Vimeo