Template:Ytc-id/doc
Documentation
This template constructs a YouTube channel identifier in any of the forms that appear in YouTube URLs:
channel/…c/…user/…@…
It doesn't actually generate a full valid URL nor a working link. Other templates that call this one do those things. (See especially {{ytc}}.)
The name of this template is based on the phrase "youtube channel identifier" or just "youtube channel id".
Usage
{{ytc-id|identifier}}{{ytc-id|channel=|c=|user=|@=}}
In the first form, the identifier value is used as-is. This can be used for any of the identifier formats.
The parameters channel, c, user, and @ correspond to the four formats seen above. They are checked in that order, and the first one with a true value is used (overriding any value used in the first positional parameter). The template provides the appropriate text in front of the value, as seen in the examples below.
The named parameter at is provided as an alias of @, but any value assigned to @ — including an empty one — will override or "hide" the value of at.
Examples
{{ytc-id|@AngelinaJordanOfficial}}⇒ @AngelinaJordanOfficial{{ytc-id|@=AngelinaJordanOfficial}}⇒ @AngelinaJordanOfficial{{ytc-id|channel/UC1Pwa4nFvIPbtYVLcBGDpjA}}⇒ channel/UC1Pwa4nFvIPbtYVLcBGDpjA{{ytc-id|channel=UC1Pwa4nFvIPbtYVLcBGDpjA}}⇒ channel/UC1Pwa4nFvIPbtYVLcBGDpjA{{ytc-id|c=AngelinaJordanOfficial}}⇒ c/AngelinaJordanOfficial{{ytc-id|channel=UC1Pwa4nFvIPbtYVLcBGDpjA|c=AngelinaJordanOfficial}}⇒ channel/UC1Pwa4nFvIPbtYVLcBGDpjA{{ytc-id|channel=|c=JonathanSugarfootMoffett|user=}}⇒ c/JonathanSugarfootMoffett{{ytc-id|channel=|c=|user=iv4nl1v3z}}⇒ user/iv4nl1v3z
The last three examples illustrate how the value of channel overrides that of c (and c would override user, and so on, as explained above), but empty values of named parameters don't override the values of other named parameters (except that an empty @= will override at).
See also
{{ytc}}and the other YouTube-related templates listed there