Template:Ytc-id/doc
Documentation
This template constructs a YouTube channel identifier in any of the forms that appear in YouTube URLs. 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 "youtube channel id".
Usage
{{ytc-id|handle}}{{ytc-id|channel=|user=|c=|handle=|at=}}
Here "handle" refers to the newest way of linking to YouTube channels, using an "at" symbol (e.g., @AngelinaJordanOfficial). When specifying the handle either as the first positional parameter or as the value of the named parameter handle, the @ symbol must be included. But you can also specify the handle using the at parameter and omit the @ symbol.
If any of channel, c, or user are specified, the template will provide the necessary text in front of those values (e.g., channel=, in the case of channel). These three parameters are checked in that order, and then at, handle, and finally the first positional parameter. The first checked parameter that has a true value is used and the rest ignored.
Examples
{{ytc-id|@AngelinaJordanOfficial}}⇒ @AngelinaJordanOfficial{{ytc-id|handle=@AngelinaJordanOfficial}}⇒{{ytc-id|at=AngelinaJordanOfficial}}⇒ @AngelinaJordanOfficial{{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
In the last three examples, notice 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 any values of other named parameters.
See also
{{ytc}}and the other YouTube-related templates listed there