Template:Tl/doc View history

No edit summary
m (19 revisions imported from usa:Template:Tl/doc)
 
(3 intermediate revisions by 2 users not shown)
Line 2: Line 2:
<!-- ADD DOCUMENTATION BELOW THIS LINE -->
<!-- ADD DOCUMENTATION BELOW THIS LINE -->


The purpose of this template is to display a {{Blue|'''T'''}}emplate {{Blue|'''l'''}}ink in a wiki, under this format {{tl|TemplateName}}, without triggering the Template transclusion as it would normally performed if you use this bracket syntax into the wikicode of the page. Its primary use is in instruction and documentation for designing Wiki pages.
__NOTOC__


==Usage==
The '''template link''' template is a simple [[w:Macro (computer science)|macro]] 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:


Use {{tlx|tl|TemplateName}} to create {{tl|TemplateName}} text.
::<code><nowiki>{{tl|Example}}</nowiki></code>


By default, the Template title, between the brackets, is an wikilink to the Template page itself.
:generates


Use {{tlx|tl|TemplateName|NOLINK}} to create the same {{tl|TemplateName|NOLINK}} text, but without the wikilink. For the ease of use, you can use {{Para||nl}} as a shorter second parameter to replace {{Para||NOLINK}}.
::{{tl|Example}}


== Examples ==
More complex variations are described below.
===Related templates===
{{tlx|tlx}} displays with the same enhanced presentation, and also expands several 'placeholder' parameters to generate a sample template call.


{| class="wikitable"
===Usage===
|-
<pre>
! This wiki syntaxt will ... !! ... produce this displayed result
{{tl|Template name to display}}
|-
and
| {{tlx|tl|TemplateName}} || {{tl|TemplateName}}
{{tlx|Template name to display}} -- local link, just like tl.
|-
or
| {{tlx|tl|TemplateName|NOLINK}} || {{tl|TemplateName|NOLINK}}
|-
| {{tlx|tl|TemplateName|nl}} || {{tl|TemplateName|nl}}
|-
| {{tlx|tl|MAGICWORD|NOLINK}} || {{tl|MAGICWORD|NOLINK}}
|-
| {{tlx|tl|:MainPageName}} || {{tl|:MainPageName}}
|-
| {{tlx|tl|User:UserPageName}} || {{tl|User:UserPageName}}
|}
 
Incorrect usage of the second parameter (supposed to be {{Para||NOLINK}} or {{Para||nl}} will result in the display of an error handling as below:
 
{{tlx|tl|TemplateName|BadSecondParameter}}<br />
will produce :<br />
{{tl|TemplateName|BadSecondParameter}}


{{tl|1==)}} -- use 1= where the template name contains an equals sign (as [[template:=)]] does).
</pre>


== See also ==
== See also ==
* [[Template:Tlx]]
* {{tl|tlx}}


<includeonly>
<includeonly>
<!-- ADD CATEGORIES BELOW THIS LINE -->
<!-- ADD CATEGORIES BELOW THIS LINE -->
[[Category:Typing-aid templates|{{PAGENAME}}]]
[[Category:Internal link templates|{{PAGENAME}}]]
<!-- ADD INTERWIKIS BELOW THIS LINE -->
<!-- ADD INTERWIKIS BELOW THIS LINE -->
</includeonly>
</includeonly>

Latest revision as of 21:01, 21 May 2020

This is a documentation subpage for Template:Tl.
It contains 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 how the template name would be used in code. Its primary use is in instruction and documentation. A short example is that the code:

{{tl|Example}}
generates
{{Example}}

More complex variations are described below.

Related templates

{{tlx}} displays with the same enhanced presentation, and also expands several 'placeholder' parameters to generate a sample template call.

Usage

 {{tl|Template name to display}}
and
 {{tlx|Template name to display}} -- local link, just like tl.
 or

 {{tl|1==)}} -- use 1= where the template name contains an equals sign (as [[template:=)]] does).

See also