Template:Tc

From Angelina Jordan Wiki
Revision as of 13:15, 25 October 2020 by Dcljr (talk | contribs) (template created)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

{{tl}}

Documentation

This template is used in template documentation to display wiki markup representing a template call, possibly including parameter values, as shown in the examples below. It should only be used on talk pages or in template documentation (or help pages, user pages, etc.), not in articles.

Unlike Template:Tl, this template does not provide a link on the name of the template in the displayed markup. If you want such a link, use {{tl}} instead.

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 the examples below).

This template styles the template call as code. To display the raw markup as plain text, {{like this}}, use {{tcnc}}.

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, as explained in the documentation of {{tc-var}}.

Examples

  • {{tc}}{{tl}}
  • {{tc|}}{{}}
  • {{tc|tc{{!}}}}{{tc|}}
  • {{tc|code}}{{code}}
  • {{tc|code}}{{code|span}}
  • {{tc|abbr}}{{abbr|NOK}}
  • {{tc|ytv|v{{=}}|t{{=}}|linktext{{=}}}}{{ytv|v=}}

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=}}

But there are also variations on this template that can (arguably) make such things even easier (in this case, {{tc-names}}). 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 (including this one in bold):    [edit this list]

  • {{tc}} – no particular formatting of parameters, to render concrete examples like {{ytv|-wKoZlapqgg}}
  • {{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}}