Template:Template link/doc

From USApedia


The template link template is a simple macro template used to display a template name as a link surrounded by braces, thus showing the template name as code rather than actually invoking it. Its primary use is in instruction and documentation where it is used to refer to a template by name without invoking it.

Note that this template may be used under the name "tee-el" (tl) as well as "tee-one" (t1)— both function the same way and produce the same results. This is not true for all such visually confusing templates containing a possible 1/l mix-up as they are not interchangeable.

{{Tla}} works exactly like {{tl}} with the addition of optionally displaying alternative label text (link label). {{tlg}} can include the use of parameters in the template (as {{{1}}}).

Examples

A short example of its use is:

Page Template:Template journal inline/styles.css has no content.{{tlLua error: expandTemplate: template "Template journal inline/arg" does not exist.}}
which generates
{{Example}}

Other longer examples:

Code Result Notes
Page Template:Template journal inline/styles.css has no content.{{tlLua error: expandTemplate: template "Template journal inline/arg" does not exist.}} {{Void}} Standard usage
Page Template:Template journal inline/styles.css has no content.{{tlsLua error: expandTemplate: template "Template journal inline/arg" does not exist.}} {{subst:Example}} For templates that should be substituted
Page Template:Template journal inline/styles.css has no content.{{tl2Lua error: expandTemplate: template "Template journal inline/arg" does not exist.}} {{X1}} This formats the link to show how it would look in code (i.e., monospace font)
Page Template:Template journal inline/styles.css has no content.{{tl2Lua error: expandTemplate: template "Template journal inline/arg" does not exist.}} {{3x}} Same as above, for templates on another Wikimedia project (in this example, Meta, using m:). See Interwiki codes.
Page Template:Template journal inline/styles.css has no content.{{tl2Lua error: expandTemplate: template "Template journal inline/arg" does not exist.}} {{WP}} For templates on another language project
Page Template:Template journal inline/styles.css has no content.{{tlLua error: expandTemplate: template "Template journal inline/arg" does not exist.}} {{=)}} Use the format {{tl|1=templatename}} if the template contains template coding characters such as {{=)}} or {{!}}

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Template link in articles based on its TemplateData.

TemplateData for Template link

This template displays a template name as a link surrounded by braces, thus showing how the template name would be used in code. Its primary use is in instruction and documentation.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Template name1

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

Templaterequired

See also

view · talk · edit


General-purpose formatting

  • 1 {{tlg}} is the most general, allowing any combination of text style and/or link style options.
  • 2 Prevents wrapping of text by placing it inside <span class="nowrap">...</span> tags.
  • 3 Uses monospace font but not <code>...</code>.
  • 4 Allows links to templates in any namespace.

Other formatting templates

Code example Effect Notes
{{tl2|Hatnote|lang=fr}} {{hatnote}} Supports linking to sister projects (e.g., fr:Hatnote)
{{tlu|User:Ahunt/SSHFS}}
  1. REDIRECT Template:Template link universal
|| Supports linking to any namespace
{{xpd|Hatnote|Some hatnote text}} Template:Xpd Shows code, example and a link to expand the template code

With utility links

Code example Effect
{{lts|Hatnote}} Template:Hatnote (edit talk links history)
{{t links|Hatnote}} Template:T links
{{tfd links|Hatnote}} Template:Tfd links
{{tiw|Hatnote}} Template:hatnote (backlinks edit)
{{tltt|Hatnote}} Template:Tltt
{{tetl|Hatnote}} {{ Hatnote }}
links talk view
{{tsetl|Hatnote}} Template:Tsetl
{{ti|Hatnote}} Template:Ti
{{tic|Hatnote}} Template:Tic
{{tiw|Hatnote}} Template:Hatnote (backlinks edit)
{{tlt|Hatnote}} Template:Tlt
{{ttl|Hatnote}} Template:Ttl
{{twlh|Hatnote}} Template:Twlh