Template:Template link code/doc

From HIBIKIFORUM
Jump to navigation Jump to search
Light bulb.png }}
It contains usage information, categories and other content that is not part of the original template page.


Purpose and naming

When a template name with braces is to be shown in documentation, the braces have to be escaped in some way so it doesn't become an actual call to the template. Instead of using <nowiki>...</nowiki> tags you can write it more simply and concisely by using the {{tlc}} template.

It works similarly to {{tl}} but doesn't make the template name into a link. When writing documentation you might want to avoid a lot of unnecessary links, since they can decrease readability. So on the first occurrence of a template name use {{tl}}, and then use {{tlc}} thereafter.

Basic operation

Here is how this template looks. Code is to the left; actual rendering to the right:

{{tlc|name|parameters}}{{name|parameters}}

Documentation

Functional details

  • This template takes another template-name and some associated pipe-tricked (numbered) parameters (or 'pass parameters'), and displays them as an 'example demonstration' of how the template-name template could be coded, literally. Its primary use is in instruction and documentation.
  • Features of {{tlc}}:
    • It shows a template name and any number of parameters.
    • It prevents line wraps in their output.

Usage

{{Tlc|Template|first_parameter|second|third|fourth|...|eighth}}{{Template|first_parameter|second|third|fourth|fifth|sixth|seventh|eighth}}

Examples

Code Result Comment
{{tlc|name}} {{name}}
{{tlc|name|one}} {{name|one}}
{{tlc|name|one|two}} {{name|one|two}}
{{tlc|name|1|2|3|4|5|6|7|8|9|10}} {{name|1|2|3|4|5|6|7|8|9|10}} Ten parameters
{{tlc|name|||three|four}} {{name|three|four}} Empty parameters are discared.
{{tlc|name|one=a|two=b}} {{name}} The use of equal signs is a problem, but there is a fix; see next row.
{{tlc|name|one{{=}}a|two{{=}}b}} {{name|one=a|two=b}} Use {{=}} in place of an equal sign, so that it gets rendered properly.

See Also

TemplateData

This template is used to link a template without actually using the template itself. Its primary use is in instruction and documentation.

Template parameters

ParameterDescriptionTypeStatus
template name1

positional parameter: the template name without the namespace prefix “Template:”, which is added automatically

Templaterequired