Template:Ytl/doc

From Angelina Jordan Wiki
This is a subpage documenting Template:Ytl. To change the template, edit that page; to change the template's documentation (seen below), edit this one.

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".

This template is used on a great many pages. Making any changes to it will cause lots of jobs to be added to the processing queue.

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

Note that the following does not work:

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.