Template:Ytl/doc
Documentation
This template forms external links to YouTube. It can be used for videos, playlists, channels, etc., but specialized templates exist for each of those cases (see list below), and those templates will generally be easier to use than this general-purpose one.
The name of the template is based on the phrase "youtube link".
Usage
{{ytl|path part of URL}}{{ytl|path part of URL|text to be linked}}{{ytl|path=path part of URL|linktext=text to be linked}}{{ytl|path=path part of URL|linktext=text to be linked|protocol=http: or https: or nothing}}
The "path part of URL" means everything after "youtube.com/" in the URL of the YouTube page you want to link to. If the path contains the equals sign (highly likely), you should probably use one of the last two forms shown above; otherwise, each equals sign would have be to "escaped", as shown in the examples below.
Note that protocol-relative URLs are formed by default, which means someone browsing the wiki in non-secure mode will get links using the http: protocol, and someone browsing in secure mode will get links using https:. This behavior can be overridden by using the protocol parameter.
Examples
{{ytl}}⇒ YouTube↗{{ytl|channel/UChM_lpT4shdnsez93QMJPig}}⇒ YouTube↗{{ytl|channel/UC1Pwa4nFvIPbtYVLcBGDpjA|Angelina Jordan Official}}⇒ Angelina Jordan Official↗{{ytl|v{{=}}nwFloCPXzCs|Angelina Jordan - I Put A Spell On You}}⇒ Angelina Jordan - I Put A Spell On You↗{{ytl|path=v=nwFloCPXzCs|linktext=Angelina Jordan - I Put A Spell On You}}⇒ Angelina Jordan - I Put A Spell On You↗
See also
Full list of similar templates (including this one in bold): [edit this list]
{{ytc}}– link to a YouTube channel (including specific tabs, like "About" or "Videos"){{ytp}}– link to a YouTube playlist{{yts}}– link to YouTube search results{{ytv}}– link to a YouTube video
These templates are all "special cases" of the more general template (which they all call):
{{ytl}}– link to any page at YouTube
And that template in turn calls {{YTURL}} and {{xl}} to form the link itself.