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}}{{ytl|path|text to be linked}}{{ytl|path=|linktext=}}{{ytl|path=|linktext=|protocol=http: or https: or nothing}}
Here "path" means everything after "youtube.com/" in the URL of the YouTube page you want to link to. If the path contains an equals sign (which is very likely), you should either "name" the positional parameters 1= and 2= in your template call (if you are trying to use the first or second form above) or use the explicitly-named parameters in the third or fourth form. Otherwise the equals sign will be interpreted as separating a parameter name from its value, resulting in a malformed link, 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:. (But note that currently this wiki can only be browsed in secure mode.) 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|1=watch?v=nwFloCPXzCs|2=Angelina Jordan - I Put A Spell On You}}⇒ Angelina Jordan - I Put A Spell On You↗{{ytl|path=watch?v=nwFloCPXzCs|linktext=Angelina Jordan - I Put A Spell On You}}⇒ Angelina Jordan - I Put A Spell On You↗
Note that the following does not work:
{{ytl|watch?v=nwFloCPXzCs|Angelina Jordan - I Put A Spell On You}}⇒ Jordan - I Put A Spell On You YouTube↗
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.