Template:Tl: Difference between revisions
| [unchecked revision] | [unchecked revision] |
Caleb Cooper (talk | contribs) m 1 revision imported |
Undid revision 948472477 by [[Special:Contributions/w>Billinghurst|w>Billinghurst]] ([[User talk:w>Billinghurst|talk]]) |
||
| Line 1: | Line 1: | ||
{{[[Template:{{{1}}}|{{{1}}}]]}}<noinclude> |
|||
{{documentation}} |
|||
__NOTOC__ |
|||
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. --> |
|||
The '''template link''' template is a simple [[w:Macro (computer science)|macro]] [[m:Help:template|template]] used to display 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. A short example is that the code: |
|||
::<code><nowiki>{{Tl|Example}}</nowiki></code> |
|||
:generates |
|||
::{{Tl|Example}} |
|||
More complex variations are described below. |
|||
===Example=== |
|||
{| align="center" class="wikitable" |
|||
! Code |
|||
! Result |
|||
|- |
|||
| <code><nowiki>{{Tl|Void}}</nowiki></code> |
|||
| {{[[Template:Void|Void]]}} |
|||
|- |
|||
| <code><nowiki>{{Tl2|X1}}</nowiki></code> |
|||
| <tt><nowiki>{{</nowiki>[[{{{LANG|}}}{{{SISTER|}}}{{ns:Template}}:X1|X1]]<nowiki>}}</nowiki></tt> |
|||
|- |
|||
| <code><nowiki>{{Tl2|SISTER=M:|3x}}</nowiki></code> |
|||
| <tt><nowiki>{{</nowiki>[[{{{LANG|}}}M:{{ns:Template}}:3x|3x]]<nowiki>}}</nowiki></tt> |
|||
|- |
|||
| <code><nowiki>{{Tl2|SISTER=wikibooks|LANG=de:|WP}}</nowiki></code> |
|||
| <tt><nowiki>{{</nowiki>[//de.wikibooks.org/wiki/Vorlage:WP WP]<nowiki>}}</nowiki></tt><!--- |
|||
----- This is currently a fraudulent output result... the template code needs modified to work |
|||
----- per this plan, then this /doc file fixed up to match whatever the correct syntax actually is. |
|||
----- ALMOST work: |
|||
[[:de:wikibooks:{{ns:template}}:WP|WP]] |
|||
[[de:wikibooks:{{ns:template}}:WP|WP]] |
|||
----> |
|||
|- |
|||
| <code><nowiki>{{Tl|1==)}}</nowiki></code> |
|||
| {{Tl|1==)}} |
|||
|} |
|||
===See also=== |
|||
* [[Template:Para]] |
|||
* {{tl|tlp}} for template with parameters |
|||
* {{tl|tls}} for template statements requiring substitution |
|||
* {{tl|cl}} for category links |
|||
{{Tl-nav}} |
|||
</noinclude> |
</noinclude> |
||
Revision as of 06:33, 1 April 2020
{{[[Template:{{{1}}}|{{{1}}}]]}}
| This template is used on many pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
| This template is used in system messages. Changes to it can cause immediate changes to the Wikipedia user interface. To avoid large-scale disruption, any changes should first be tested in this template's /sandbox or /testcases subpage, or in your own user space. The tested changes can then be added in one single edit to this template. Please discuss any changes on the talk page before implementing them. |
| This page was automatically imported from Commons any changes will be overwritten, the source page is here () |
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: and are not interchangeable.
{{Template:Template link with alternate text}} 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:
{{tl|Example}}
- which generates
- {{Example}}
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 Tl
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 | Line | required |
See also
For more detail: wikipedia:Template:Tl/doc