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
 
(9 intermediate revisions by the same user not shown)
Line 2: Line 2:
{{Documentation subpage}}
{{Documentation subpage}}
<!-- Categories go where indicated at the bottom of this page, please; interwikis go to Wikidata (see also: [[Wikipedia:Wikidata]]). -->
<!-- Categories go where indicated at the bottom of this page, please; interwikis go to Wikidata (see also: [[Wikipedia:Wikidata]]). -->
{{redirect-distinguish|Template:TI|Template:Ti}}{{Template shortcut|tl|TL|t|temp}}
{{#ifeq:{{FULLPAGENAME}} | Template:Template link | {{cascade-protected template}} }}
{{#ifeq:{{FULLPAGENAME}} | Template:Template link | {{used in system}} {{cascade-protected template}} }}
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.  
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.
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.


'''{{tl|Tla}}''' works exactly like {{tl|tl}} with the addition of optionally displaying '''a'''lternative label text (link label).  '''{{tl|tlg}}''' can include the use of parameters in the template (as  <nowiki>{{{1}}}</nowiki>).
'''''' works exactly like with the addition of optionally displaying '''a'''lternative label text (link label).  '''''' can include the use of parameters in the template (as  <nowiki>{{{1}}}</nowiki>).


==Examples==
==Examples==
A short example of its use is:
A short example of its use is:


::{{tji|tl|Example}}
::
:which generates
:which generates
::{{tl|Example}}
 


Other longer examples:
Other longer examples:
Line 24: Line 23:
! Notes
! Notes
|-
|-
| {{tji|tl|Void}}
|  
| {{tl|Void}}
|  
| Standard usage
| Standard usage
|-
|-
| {{tji|tls|Example}}
|  
| {{tls|Example}}
|  
| For templates that should be substituted
| For templates that should be substituted
|-
|-
| {{tji|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&#58;|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 49:
| For templates on another language project
| For templates on another language project
|-
|-
| {{tji|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></nowiki></code> if the template contains template coding characters such as or  
|}
|}


Line 69: Line 68:
"format": "inline"
"format": "inline"
}</templatedata>
}</templatedata>
== See also ==
* {{tiw|tl2}}
* {{tiw|tl}}
* {{tiw|tlp}} to produce a [t]emplate [l]ink with a single [p]arameter.
* {{tiw|tlx}} to produce a [t]emplate [l]ink with an e[x]panded number of parameters.
* {{tiw|tlsp}} to produce a [t]emplate [l]ink that's [s]ubst:ituted, with a single [p]arameter.
* {{tiw|lts}}
* {{tiw|tlu}}, tl or tlp in any namespace.
* {{lcs|Internal template-link templates}}
* {{tiw|tl-r}} to produce a [t]emplate [l]ink to a template [r]edirect.
{{Template-linking templates}}


<includeonly>{{Sandbox other||
<includeonly>{{Sandbox other||

Latest revision as of 06:53, 14 April 2025

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

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.

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

Examples

A short example of its use is:

which generates


Other longer examples:

Code Result Notes
Standard usage
For templates that should be substituted
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 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