[ Disclaimer, Create new user --- Wiki markup help, Install P99 ]
Difference between revisions of "Template:Youtube"
Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
− | This template allows you to embed a Youtube video in a page. To use it you simply | + | This template allows you to embed a Youtube video in a page. To use it you simply provide the ID of a Youtube video, and optionally a height and width. |
− | Although you can use this template anywhere (appropriate) in the wiki, the [[Videos]] page is one great place to start. | + | Although you can use this template anywhere (that is appropriate) in the wiki, the [[Videos]] page is one great place to start. |
− | == | + | == Finding a Video's ID == |
− | + | Every Youtube video includes its ID in its URL. For instance, if you right click on the Green Trailer video and choose "Copy video URL", you'd get the URL: | |
− | <code><nowiki> | + | <code><nowiki>https://youtu.be/CBttHicGbek</nowiki></code> |
− | + | The ID is the part after "https://youtu.be/", in other words: | |
− | <code><nowiki> | + | <code><nowiki>https://youtu.be/</nowiki></code>'''CBttHicGbek''' |
+ | |||
+ | Other Youtube URLs may put it elsewhere, but it always be present. For instance, if you visit the Youtube page for that video, it will take you to: | ||
+ | |||
+ | <code><nowiki>https://www.youtube.com/watch?v=</nowiki></code>'''CBttHicGbek''' | ||
== Examples == | == Examples == | ||
Line 29: | Line 33: | ||
{{youtube | {{youtube | ||
| id=CBttHicGbek | | id=CBttHicGbek | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
| height=400 | | height=400 | ||
| width=400 | | width=400 | ||
}} | }} | ||
</noinclude><includeonly><div class="youtube-placeholder" {{#if: {{{height}}}| data-height="{{{height}}}"}} {{#if: {{{width}}}| data-width="{{{width}}}"}} data-url="{{{url|https://www.youtube.com/embed/{{{1|{{{id|}}}}}}}}}">Loading Video ...</div></includeonly> | </noinclude><includeonly><div class="youtube-placeholder" {{#if: {{{height}}}| data-height="{{{height}}}"}} {{#if: {{{width}}}| data-width="{{{width}}}"}} data-url="{{{url|https://www.youtube.com/embed/{{{1|{{{id|}}}}}}}}}">Loading Video ...</div></includeonly> |
Revision as of 17:05, 25 October 2019
This template allows you to embed a Youtube video in a page. To use it you simply provide the ID of a Youtube video, and optionally a height and width.
Although you can use this template anywhere (that is appropriate) in the wiki, the Videos page is one great place to start.
Contents |
Finding a Video's ID
Every Youtube video includes its ID in its URL. For instance, if you right click on the Green Trailer video and choose "Copy video URL", you'd get the URL:
https://youtu.be/CBttHicGbek
The ID is the part after "https://youtu.be/", in other words:
https://youtu.be/
CBttHicGbek
Other Youtube URLs may put it elsewhere, but it always be present. For instance, if you visit the Youtube page for that video, it will take you to:
https://www.youtube.com/watch?v=
CBttHicGbek
Examples
Example #1: Basic
{{youtube | CBttHicGbek}}
Example #2: Specific Dimensions
{{youtube
| id=CBttHicGbek
| height=400
| width=400
}}