Template:Tc-var/doc

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

Documentation

This template is used in template documentation to display wiki markup representing a template call with generic (i.e., variable) positional 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 and Template:Tlnc, this template does not provide a link on the name of the template in the displayed markup.

This template styles the template call as code. There is no option to display it as plain text.

The name of this template is based on the phrase "template call with variable parameter values".

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-var|template name|description of parameter 1|description of parameter 2||add=}}

Up to 19 positional parameters can be described using this template. If you need more, or if you want to tack on additional parameters of a different type, you can use the add parameter, as described below.

Examples

  • {{tc-var}}{{}}
  • {{tc-var|}}{{}}
  • {{tc-var|code}}{{code}}
  • {{tc-var|code|content to be rendered as code}}{{code|content to be rendered as code}}
  • {{tc-var|wl|target|linktext}}{{wl|target|linktext}}
  • {{tc-var|ytv|ID|linktext|add={{pn|t|accessed}}}}{{ytv|ID|linktext|t=|accessed=}}

Obviously, the first three examples are not very useful; they're just here for "completeness".

The last example shows how to use add along with {{pn}} to include additional named parameters. Other similar templates can display name-value pairs, variable values only, etc. These are explained immediately below.

Using add

The only thing the add parameter does is display its input value immediately before the end of the template call markup (the }} characters). The text that is so displayed needs to be formatted to look like additional parameters. This is done using the following templates:

  • {{p}} – no particular formatting of parameters: {{p|A|B|C|D}} ⇒ A|B|C|D
  • {{pn}} – shows parameter names only: {{pn|A|B|C|D}} ⇒ A=|B=|C=|D=
  • {{pnv}} – shows parameter name/value pairs: {{pnv|A|B|C|D}} ⇒ A=B|C=D
  • {{pnvv}} – shows parameter names with generic (variable) values: {{pnvv|A|B|C|D}} ⇒ A=B|C=D
  • {{pv}}}} – shows only variable parameter values: {{pv|A|B|C|D}}A|B|C|D

Notice how none of these parameters format their output as code. This is because they are intended to be used inside of calls to templates that provide that sort of formatting already.

Alias

See also

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