Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Template link/doc: Difference between revisions

Template page
No edit summary
No edit summary
Line 13: Line 13:
A short example of its use is:
A short example of its use is:


::{{tji|tl|Example}}
::
:which generates
:which generates
::{{tl|Example}}
::{{tl|Example}}
Line 24: Line 24:
! Notes
! Notes
|-
|-
| {{tji|tl|Void}}
|  
| {{tl|Void}}
| {{tl|Void}}
| Standard usage
| Standard usage
|-
|-
| {{tji|tls|Example}}
|  
| {{tls|Example}}
| {{tls|Example}}
| For templates that should be substituted
| For templates that should be substituted
|-
|-
| {{tji|tl2|X1}}
|  
| {{tl2|X1}}
| {{tl2|X1}}
| This formats the link to show how it would look in code (i.e., monospace font)
| This formats the link to show how it would look in code (i.e., monospace font)
|-
|-
| {{tji|tl2|sister: M:|3x}}
|  
| <code><nowiki>{{</nowiki>3x<nowiki>}}</nowiki></code>
| <code><nowiki>{{</nowiki>3x<nowiki>}}</nowiki></code>
| Same as above, for templates on another Wikimedia project (in this example, Meta, using '''<code>m:</code>'''). See Interwiki codes.
| Same as above, for templates on another Wikimedia project (in this example, Meta, using '''<code>m:</code>'''). See Interwiki codes.
|-
|-
| {{tji|tl2|sister: wikibooks|lang: de&#58;|WP}}
|  
| <code><nowiki>{{</nowiki>[http://de.wikibooks.org/wiki/Vorlage:WP WP]<nowiki>}}</nowiki></code><!--
| <code><nowiki>{{</nowiki>[http://de.wikibooks.org/wiki/Vorlage:WP WP]<nowiki>}}</nowiki></code><!--
––––– This is currently a fraudulent output result... the template code needs modified to work
––––– This is currently a fraudulent output result... the template code needs modified to work
Line 50: Line 50:
| For templates on another language project
| For templates on another language project
|-
|-
| {{tji|tl|1: {{=}})}}
|  
| {{tl|1==)}}
| {{tl|1==)}}
| Use the format <code><nowiki>{{tl|1=templatename}}</nowiki></code> if the template contains template coding characters such as {{tl|1==)}} or {{tl|1=!}}
| Use the format <code><nowiki>{{tl|1=templatename}}</nowiki></code> if the template contains template coding characters such as {{tl|1==)}} or {{tl|1=!}}

Revision as of 03:58, 9 April 2025

This page uses Creative Commons Licensed content from Wikipedia (view authors).

Template:Redirect-distinguish

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:

which generates
{{Example}}

Other longer examples:

Code Result Notes
{{Void}} Standard usage
Template:Tls For templates that should be substituted
Template:Tl2 This formats the link to show how it would look in code (i.e., monospace font)
{{3x}} Same as above, for templates on another Wikimedia project (in this example, Meta, using m:). See Interwiki codes.
{{WP}} For templates on another language project
{{=)}} 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

Template:Template-linking templates