Template:YouTube link: Difference between revisions
Template page
More actions
m Link YouTube video labels directly |
m Replace reader-visible prose double hyphens with a proper em dash entity |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<includeonly><templatestyles src="Template:YouTube link/styles.css" />{{#if:{{{id|{{{1|}}}}}}|<span class="loka-youtube-link">[https://www.youtube.com/watch?v={{{id|{{{1|}}}}}} {{{label|{{PAGENAME}}}}}] on [[File:YouTube icon.png|14px|link=|alt=YouTube]] YouTube</span>{{#ifeq:{{lc:{{{explicit|}}}}}|yes|<span class="loka-youtube-link-warning">Please note this video may contain strong language</span>}}}}</includeonly><noinclude> | <includeonly><templatestyles src="Template:YouTube link/styles.css" />{{#if:{{{id|{{{1|}}}}}}|<span class="loka-youtube-link">[https://www.youtube.com/watch?v={{{id|{{{1|}}}}}} "{{{label|{{PAGENAME}}}}}"] {{#if:{{{official|}}}|from <span class="loka-icon-loka">[[File:Loka icon.png|14px|link=|alt=Loka]]</span> Loka's [[File:YouTube icon.png|14px|link=|alt=YouTube]] YouTube|on [[File:YouTube icon.png|14px|link=|alt=YouTube]] YouTube{{#if:{{{credit|}}}|<span class="loka-youtube-link-credit"> (credit: {{{credit|}}})</span>}}}}</span>{{#ifeq:{{lc:{{{explicit|}}}}}|yes|<span class="loka-youtube-link-warning">Please note this video may contain strong language</span>}}}}</includeonly><noinclude> | ||
== Usage == | == Usage == | ||
<pre>{{YouTube link|id=VIDEO_ID|label=Video title}}</pre> | <pre>{{YouTube link|id=VIDEO_ID|label=Video title|credit=Recorder name}}</pre> | ||
The first unnamed parameter can be used instead of <code>id</code>. The linked label defaults to the page name | The first unnamed parameter can be used instead of <code>id</code>. The linked label defaults to the page name and is always shown in quotes | ||
Set <code>explicit=yes</code> to show the strong-language notice | Set <code>explicit=yes</code> to show the strong-language notice. <code>credit</code> is optional and, when given, shows who recorded/uploaded the video | ||
Set <code>official=yes</code> for a video uploaded by the official Loka Minecraft channel — this shows "from [[File:Loka icon.png|14px|link=|alt=Loka]] Loka's [[File:YouTube icon.png|14px|link=|alt=YouTube]] YouTube" instead of a per-video credit, since the whole channel is already the attribution | |||
[[Category:External link templates]] | [[Category:External link templates]] | ||
</noinclude> | </noinclude> | ||
Latest revision as of 14:21, 23 August 2026
Usage
{{YouTube link|id=VIDEO_ID|label=Video title|credit=Recorder name}}
The first unnamed parameter can be used instead of id. The linked label defaults to the page name and is always shown in quotes
Set explicit=yes to show the strong-language notice. credit is optional and, when given, shows who recorded/uploaded the video
Set official=yes for a video uploaded by the official Loka Minecraft channel — this shows "from
Loka's
YouTube" instead of a per-video credit, since the whole channel is already the attribution