More actions
No edit summary |
No edit summary |
||
| (3 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]]). --> | ||
{{#ifeq:{{FULLPAGENAME}} | Template:Template link | {{cascade-protected template}} }} | |||
{{#ifeq:{{FULLPAGENAME}} | Template:Template link | | |||
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. | ||
'''''' works exactly like | '''''' 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== | ||
| Line 15: | Line 14: | ||
:: | :: | ||
:which generates | :which generates | ||
Other longer examples: | Other longer examples: | ||
| Line 25: | Line 24: | ||
|- | |- | ||
| | | | ||
| | | | ||
| Standard usage | | Standard usage | ||
|- | |- | ||
| Line 33: | Line 32: | ||
|- | |- | ||
| | | | ||
| | | | ||
| 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) | ||
|- | |- | ||
| Line 51: | Line 50: | ||
|- | |- | ||
| | | | ||
| | | | ||
| Use the format <code><nowiki> | | Use the format <code><nowiki></nowiki></code> if the template contains template coding characters such as or | ||
|} | |} | ||
Latest revision as of 06:53, 14 April 2025
| This page uses Creative Commons Licensed content from Wikipedia (view authors). |
| This is a documentation subpage for Template:Template link It may contain usage information, categories and other content that is not part of the original template page. |
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
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 |