Template: Edit

Editing Template:Template link/doc

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
<!-- Categories go where indicated at the bottom of this page -->
+
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
{{redirect-distinguish|Template:TI|Template:Ti}}{{Template shortcut|tl|TL|t|temp}}
+
===Usage===
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 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.
+
;{{Tl|Tl|template name|first parameter|}}:Up to three parameters for the specified template are displayed as placeholders, more parameters are shown as "<tt>|</tt>''etc.''".
 
 
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>).
 
 
 
==Examples==
 
A short example of its use is:
 
 
 
::{{tji|tl|Example}}
 
:which generates
 
::{{tl|Example}}
 
 
 
Other longer examples:
 
  
 +
===Example===
 
{| class="wikitable"
 
{| class="wikitable"
! Code
+
!Code
! Result
+
!Result
! Notes
+
!Remark
 +
|-
 +
|{{Tl|Tl|x0}}
 +
|{{Tl|x0}}
 +
||&#160;
 +
|-
 +
|{{Tl|Tl|x1|one}}
 +
|{{Tl|x1|one}}
 +
||&#160;
 +
|-
 +
|{{Tl|Tl|x2|one|two}}
 +
|{{Tl|x2|one|two}}
 +
||&#160;
 +
|-
 +
|{{Tl|Tl|x3|1<tt>&#124;</tt>2<tt>&#124;</tt>3}}
 +
|{{Tl|x3|1|2|3}}
 +
||&#160;
 +
|-
 +
|{{Tl|Tl|x4|1<tt>&#124;</tt>2<tt>&#124;</tt>3|4}}
 +
|{{Tl|x4|1|2|3|4}}
 +
|up to 3 parameters
 +
|-
 +
|{{Tl|Tl|x4|1<tt>&#124;</tt>2<tt>&#124;</tt>3&amp;#124;4}}
 +
|{{Tl|x4|1|2|3&#124;4}}
 +
|<tt>&amp;#124;</tt> for more
 +
|-
 +
|{{Tl|Tl|x1|x&#61;u}}
 +
|{{Tl|x1|x=u}}
 +
|'''=''' won't work
 +
|-
 +
|{{Tl|Tl|x1|x&amp;#61;u}}
 +
|{{Tl|x1|x&#61;u}}
 +
|<tt>&amp;#61;</tt> is okay
 +
|-
 +
|{{Tl|Tl|x1|&lt;nowiki&gt;x&#61;u&lt;/nowiki&gt;}}
 +
|{{Tl|x1|<nowiki>x=u</nowiki>}}
 +
|sticky nowiki is okay
 +
|-
 +
|{{Tl|Tl|x2|&#160;|two}}
 +
|{{Tl|x2| |two}}
 +
|empty won't work
 +
|-
 +
|{{Tl|Tl|x2|&amp;#32;|two}}
 +
|{{Tl|x2|&#32;|two}}
 +
|<tt>&amp;#32;</tt> is okay
 
|-
 
|-
| {{tji|tl|Void}}
+
|{{Tl|Tl|x2|&amp;nbsp;|two}}
| {{tl|Void}}
+
|{{Tl|x2|&nbsp;|two}}
| Standard usage
+
|<tt>&amp;nbsp;</tt> is okay
 
|-
 
|-
| {{tji|tls|Example}}
+
|{{Tl|Tl|x2| &amp;#124; two}}
| {{tls|Example}}
+
|{{Tl|x2| &#124; two}}
| For templates that should be [[BattleTechWiki:Substitution|substituted]]
+
|<tt>&amp;#124;</tt> is okay
 
|-
 
|-
| {{tji|tl2|X1}}
+
|{{Tl|Tl|x2| {&#123;!&#125;} two}}
| {{tl2|X1}}
+
|{{Tl|x2| {{!}} two}}
| This formats the link to show how it would look in code (i.e., monospace font)
+
|{{Tl|!}} is dubious
 
|-
 
|-
| {{tji|tl|1: !}}
+
|{{Tl|Tl|x2|<nowiki>2=</nowiki>|<nowiki>3=two</nowiki>}}
| {{tl|1=!}}
+
|{{Tl|x2|2=|3=two}}
| Use the format <code><nowiki>{{tl|1=templatename}}</nowiki></code> if the template contains template coding characters such as {{tl|1=!}}
+
|empty really doesn't work
 +
|-
 +
|{{Tl|Tl|x2|<nowiki>2=one</nowiki>|two}}
 +
|{{Tl|x2|2=one|two}}
 +
|'''two''' clobbers '''2=one'''
 +
|-
 +
|{{Tl|Tl|x2|<nowiki>3=two</nowiki>|<nowiki>2=one</nowiki>}}
 +
|{{Tl|x2|3=two|2=one}}
 +
|right to left okay
 
|}
 
|}
 +
<includeonly>
 +
<!-- ADD CATEGORIES BELOW THIS LINE -->
 +
[[Category:Internal link templates|Tl]]
 +
[[Category:Templates using ParserFunctions|Tl]]
 +
[[Category:Templates|{{PAGENAME}}]]
 +
<!-- ADD INTERWIKIS BELOW THIS LINE -->
  
== TemplateData ==
+
</includeonly>
{{TemplateData header}}
 
<templatedata>{
 
"description": "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.",
 
"params": {
 
"1": {
 
"label": "Template name",
 
"description": "Positional parameter: the template name without the namespace prefix “Template:”, which is added automatically",
 
"type": "wiki-template-name",
 
"required": true
 
}
 
},
 
"format": "inline"
 
}</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 [[BattleTechWiki:Substitution|[s]ubst:]]ituted, with a single [p]arameter.
 
* {{tiw|lts}}
 
* {{tiw|tlu}}, tl or tlp in any [[BattleTechWiki:Namespaces|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||
 
<!-- Categories go below this line, please; interwikis go to Wikidata, thank you! -->
 
[[Category:Internal template-link templates]]
 
}}</includeonly>
 

Please note that all contributions to BattleTechWiki are considered to be released under the GNU FDL 1.2 (see BattleTechWiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Advanced templates:

Editing: {{Merge}}   {{Moratorium}}   {{Otheruses| | | }}

Notices: {{NoEdit}}   {{Sign}}   {{Unsigned|name}}   {{Welcome}}

Administration: {{Essay}}   {{Policy}}   {{Procedure}}

Templates used on this page: