Template:Template link
{{[[Template:{{{1}}}|{{{1}}}]]}}
| This template is used in system messages, and on approximately 7,620,000 pages, or roughly 11% of all pages. Changes to it can cause immediate changes to the Wikipedia user interface. To avoid major disruption and server load, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. Please discuss changes on the talk page before implementing them. |
| This template can only be edited by administrators because it is transcluded onto one or more cascade-protected pages. |
| This template should never be substituted – use {{tl}}. |
Template link displays a template name as a link surrounded by braces, thus showing the template name as code rather than actually invoking it.
Note that this template has aliases {{tl}} ("T el") and {{t1}} ("T one"). They should not be confused with {{ti}} ("T eye"), which is an alias for {{Template information}}.
{{Tla}} works exactly like {{tl}} but allows displaying alternative label text (link label).
{{Tlg}} can display parameters for the template.
Examples
A short example of its use:
Other longer examples:
| Code | Result | Notes |
|---|---|---|
{{tl|Void}} |
{{Void}} | Standard usage |
{{tls|Example}} |
{{subst:Example}} | For templates that should be substituted |
{{tl2|X1}} |
{{X1}} |
This formats the link to show how it would look in code (i.e., monospace font) |
{{tl2|sister=M:|3x}} |
{{3x}} |
Same as above, for templates on another Wikimedia project (in this example, Meta, using m:). See Interwiki codes. |
{{tl2|sister=wikibooks|lang=de:|WP}} |
{{WP}} |
For templates on another language project |
{{tl|1==)}} |
{{=)}} | Use the format {{tl|1=templatename}} if the template contains template coding characters such as {{=)}} or {{!}} |
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.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Template name | 1 | Positional parameter: the template name without the namespace prefix “Template:”, which is added automatically | Template | required |
See also
- Template:tl2 (backlinks edit)
- Template:tl (backlinks edit)
- Template:tlp (backlinks edit) to produce a [t]emplate [l]ink with a single [p]arameter
- Template:tlx (backlinks edit) to produce a [t]emplate [l]ink with an e[x]panded number of parameters
- Template:tlsp (backlinks edit) to produce a [t]emplate [l]ink that's [s]ubst:ituted, with a single [p]arameter
- Template:lts (backlinks edit)
- Template:tlu (backlinks edit), tl or tlp in any namespace
- (edit talk links history)
- Template:tl-r (backlinks edit) to produce a [t]emplate [l]ink to a template [r]edirect
General-purpose formatting
| Templ. | Example output | Text style | Link style | Subst style | {{tlg}} equivalent | Notes |
|---|---|---|---|---|---|---|
| {{tlg}} | {{tlg}} | normal | N/a | Most general: accepts any combination of the options below | ||
| {{tl}} | {{tl}} | |||||
| {{tlp}} | {{tlp|1|2|...}} | No wrapping | ||||
| {{tlu}} | {{Template:tlu}} | Any namespace | ||||
| {{tlf}} | {{tlf}} | nolink=yes |
No wrapping | |||
| {{tls}} | {{subst:tls}} | subst=yes | ||||
| {{tlsu}} | {{subst:Template:tlsu}} | Any namespace | ||||
| {{tlsf}} | {{subst:tlsf}} | nolink=yes subst=yes |
No wrapping | |||
| {{tn}} | {{tn}} | braceinside=yes |
||||
| {{tla}} | {{tla}} | alttext=Foo or 2=Foo | ||||
| {{tl2}} | {{tl2}} |
code | code=yes | |||
| {{tlx}} | {{tlx}} | |||||
| {{tlxu}} | {{Template:tlxu}} |
Any namespace | ||||
| {{tlc}} | {{tlc}} |
code=yes nolink=yes |
No wrapping | |||
| {{tnull}} | {{tnull}} |
|||||
| {{tlxs}} | {{subst:tlxs}} |
code=yes subst=yes | ||||
| {{tlsc}} | {{subst:tlsc}} |
code=yes nolink=yes subst=yes |
No wrapping | |||
| {{tltss}} | {{subst:tltss}} | monospace | plaincode=yes subst=yes |
Sets font to monospace | ||
| {{tlb}} | {{tlb}} | bold | bold=yes |
|||
| {{tlxb}} | {{tlxb}} |
bold + code | bold=yes code=yes | |||
| {{tlxi}} | {{tlxi}} |
italic + code | italic=yes code=yes |
Styles with no dedicated template are available only through {{tlg}}: plaincode=yes renders monospace with <code style="border: none; background-color: transparent;">, and kbd=yes renders with <kbd>...</kbd>.
Other formatting templates
| Code example | Effect | Notes |
|---|---|---|
<syntaxhighlight lang="wikitext">
{{Hatnote
| Some text
| selfref = yes
| category = no
| lang = fr
}}
</syntaxhighlight>
|
{{Hatnote
| Some text
| selfref = yes
| category = no
| lang = fr
}}
|
Same as above |
<syntaxhighlight lang="wikitext" inline>
{{Template|Text|links=yes}}
</syntaxhighlight>
|
{{Template|Text|links=yes}} | |
{{tl2|Hatnote|lang=fr}} |
{{hatnote}} |
Supports linking to sister projects (e.g., fr:Hatnote) |
{{demo|<nowiki>{{Hatnote|Some text}}</nowiki>}} |
{{hatnote|Some text}}
|
Shows code and example |
{{tln|Hatnote}} |
Template:Hatnote | Produces a normal link to the template |
{{elc|Template:Example}} |
[[Template:Example]] |
Shows how wikilink would be entered in wiki markup, with optional link text and suffix |
{{elc|Template:Example|Text|suffix}} |
[[Template:Example|Text]]suffix | |
{{ml|Example|hello}} |
{{#invoke:Example|hello}} | Counterpart to {{tl}} for linking to Lua modules |
{{mfl|Example|hello}} |
{{#invoke:Example|hello}} | Similar to {{ml}}, but expects the function to be documented and creates a link to the corresponding section |
{{mlx|Example|hello}} |
{{#invoke:Example|hello}} |
Counterpart to {{tlx}} for linking to Lua modules |
{{ml-lua|Module:Example}} |
require('Module:Example') |
Link to Lua modules and built-in libraries, showing Lua code. |
{{para|title|<var>book title</var>}} |
|title=book title |
Formats template parameters for display, with or without values |
{{sclx|LASTING}} |
[[WP:LASTING]] |
Takes a shortcut suffix in project namespace and displays it with brackets and the WP: alias in a <code>...</code> tag. |
{{tag|ref}} |
<ref>...</ref> |
Formats [X]HTML tags; can add content, choose opening, closing, or self-closing |
{{xtag|templatedata}} |
<templatedata> | |
{{dtl|Ping project}} |
{{d:Ping project}} | Wikidata counterpart to {{tl}} |
{{mwl|#if}} |
{{#if}} | Magic word links |
{{mwl|#if|{{{1}}}|true|false}} |
{{#if:{{{1}}}|true|false}} | |
{{pf|if}} |
{{#if}} | Parser function equivalent to {{tl}} |
{{pf|if|{{{1}}}|true|false}} |
{{#if:{{{1}}}|true|false}} |
With utility links
| Code example | Effect |
|---|---|
{{lt|Hatnote}} |
Template:Hatnote (edit | talk | history | links | watch | logs) |
{{lts|Hatnote}} |
Template:Hatnote(edit talk links history) |
{{t links|Hatnote}} |
{{Hatnote}} (edit talk history links # /subpages /doc /doc edit /sbox /sbox diff /test) |
{{tfd links|Hatnote}} |
Template:Hatnote (talk · history · transclusions · logs · subpages) |
{{tetl|Hatnote}} |
{{Hatnote}} |
{{tsetl|Hatnote}} |
{{subst:Hatnote}} |
{{ti|Hatnote}} |
Template:Hatnote (talk · links · edit) |
{{tic|Hatnote}} |
Template:Hatnote (talk links edit) |
{{tiw|Hatnote}} |
Template:Hatnote (backlinks edit) |
{{tlt|Hatnote}} |
{{Hatnote}} (talk) |
{{ttl|Hatnote}} |
Template:Hatnote (links, talk) |
{{twlh|Hatnote}} |
Template:Hatnote (links, talk) |