Template:Tc/doc

From Angelina Jordan Wiki
Revision as of 14:04, 22 June 2024 by Dcljr (talk | contribs) (sigh…)
This is a subpage documenting Template:Tc. To change the template, edit that page; to change the template's documentation (seen below), edit this one.

Documentation

This template is used to display the wiki markup that would form a call to a template (i.e., using double curly-braces: {{}}). Unlike Template:Tl and Template:Tlnc, the name of the template is not linked to the template page. This should only be used on talk pages or in template documentation (or help pages, user pages, etc.), not in articles. If no input is given to the template, it uses the phrase "template call" (as seen above), but this can be suppressed by passing the template empty input (i.e., {{tc|}} — see examples below).

This template styles the template call as code, {{like this}}. To display it as plain text, {{like this}}, use Template:Tcnc.

If you want the template name to be linked to the template page, use Template:Tl or Template:Tlnc.

The name of this template is based on the phrase "template call".

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

  • {{tc|template name}}
  • {{tc|template name|parameter}}
  • {{tc|template name|parameter1|parameter2||add=|sp=}}

Up to 19 parameters can be displayed. If you need more, you can use add.

Examples

  • {{tc}}{{template call}}
  • {{tc|}}{{}}
  • {{tc|tc{{!}}}}{{tc|}}
  • {{tc|code}}{{code}}
  • {{tc|code|span}}{{code|span}}
  • {{tc|abbr|NOK|Norwegian krone}}{{abbr|NOK|Norwegian krone}}
  • {{tc|ytv|v{{=}}|t{{=}}|linktext{{=}}}}{{ytv|v=|t=|linktext=}}

As seen in the last example, when illustrating calls with multiple named parameters, there is little benefit in using this template over simply wrapping the entire sample template call in <nowiki> tags. In particular, the same thing could be accomplished by doing:

  • <code><nowiki>{{ytv|v=|t=|linktext=}}</nowiki></code>{{ytv|v=|t=|linktext=}}

Note that there are also variations on this template that can (arguably) make such things even easier. These are listed below.

See also

  • {{tcnc}} — same as this template, but renders the template link as plain text (not code)
  • {{tl}} — similar to this template, but links the template name

Full list of similar templates:    [edit this list]

  • {{tc}} – no particular formatting of parameters, to render concrete examples like {{ytv|-wKoZlapqgg|Love Don't Let Me Go}}
  • {{tc-names}} – shows only parameter names with no values, like {{ytv|v=|t=|linktext=}}
  • {{tc-nameval}} – shows a concrete example with name-value pairs, like {{ytv|v=-wKoZlapqgg|linktext=Love Don't Let Me Go}}
  • {{tc-namevar}} – shows name-value pairs with generic (variable) values, like {{ytv|v=video ID|linktext=text to be linked}}
  • {{tc-numvar}} – shows numerical parameters with generic (variable) values, like {{ytv|1=video ID|2=text to be linked}}
  • {{tc-var}} – shows only variable values to explain positional parameters, like {{ytv|video ID|text to be linked}}