Warning
This is an unofficial archive of PsychonautWiki as of 2025-08-11T15:14:44Z. Content on this page may be outdated, incomplete, or inaccurate. Please refer to the original page for the most up-to-date information.

Template:Tl/doc: Difference between revisions

From PsychonautWiki Archive
Jump to navigation Jump to search
iw>DePiep
high-risk|2,500,000+
 
>PJosepherum
m 1 revision imported: For UploadWizard
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Documentation subpage}}
: For the '''Tagalog language''' template, see {{t|tgl}}
{{high-risk|2,500,000+}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
__NOTOC__
__NOTOC__
-----
{{TemplateBox
|1=1
|1d=template name
|1def=[[Template:{{BASEPAGENAME}}|{{BASEPAGENAME}}]]
|1stat=
|2=2
|2d=display name
|2def=parameter 1
|2stat=
|3=3
|3d=interwiki language code (can also be specified with <code>lang=</code>)
|3def=
|3stat=
|4=code
|4d=any value, for a sourrounding <code><nowiki><code></nowiki></code> tag &ensp;(like {{Tl|Tl2}})
|4def=
|4stat=optional-
|5=incl
|5d=numeric value,
*0:  both brackets are not a part of the link, &ensp;like {{Tl|Tl}}
*1:  the inner brackets are part of the link  &ensp;like {{T1|T1}}
*2:  both brackets are part of the link, &ensp;like {{T|T}}
|5def=0
|5stat=optional-
|6=parm
|6d=to display templates parameters &ensp; (like {{Tl|Tlx}}) <br> e.g."<code><nowiki>parm=&amp;#124;1=&amp;#124;2=&amp;#124;code=y</nowiki></code>"<br>gives "<code><nowiki>&#124;1=&#124;2=&#124;code=y</nowiki></code>"
|6def=
|6stat=optional-
|desc='''Tl''' stands for '''T'''emplate '''l'''ink. It creates a link to a template and surrounds it with <code>{{</code>...<code>}}</code>.
|namespace=
|usergroup=
|placement=
|usage-notes=
|type=
|example=
|example-value=
|seealso=
|setscats=
|lines=
|shorthand=
|relieson=
|mustbesubst=
}}


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:
== Examples ==
* {{tlf|Tl|information}} → {{tl|information}}


::<code><nowiki>{{Tl|Example}}</nowiki></code>
*<nowiki>{{Tl}}</nowiki> → {{Tl}}
:generates
*<nowiki>{{Tl|coltit}}</nowiki> → {{Tl|coltit}}
::{{Tl|Example}}
*<nowiki>{{Tl|coltit|incl=0}}</nowiki> → {{Tl|coltit|incl=0}}
*<nowiki>{{Tl|coltit|incl=1}}</nowiki> → {{Tl|coltit|incl=1}}
*<nowiki>{{Tl|coltit|incl=2}}</nowiki> → {{Tl|coltit|incl=2}}
*<nowiki>{{Tl|Coltit|coltit}}</nowiki> → {{Tl|Coltit|coltit}}
*<nowiki>{{Tl|Coltit|test|en}}</nowiki> → {{Tl|Coltit|test|en}}
*<nowiki>{{Tl|Coltit|3=de}}</nowiki> → {{Tl|Coltit|3=de}}<br>
with <code>code=y</code>
*<nowiki>{{Tl|U|user|code=y|parm=&amp;#124;1=&amp;#124;2=&amp;#124;parameter=}}</nowiki> → {{Tl|U|user|code=y|parm=&#124;1=&#124;2=&#124;parameter=}}
*<nowiki>{{Tl|coltit|code=y}}</nowiki> → {{Tl|coltit|code=y}}
*<nowiki>{{Tl|Coltit|coltit|code=y|incl=1}}</nowiki> → {{Tl|Coltit|coltit|code=y|incl=1}}
*<nowiki>{{Tl|Coltit|color titling|en|code=y}}</nowiki> → {{Tl|Coltit|color titling|en|code=y}}
*<nowiki><tt>{{Tl|Coltit|3=de|code=y}}</tt></nowiki> → <tt>{{Tl|Coltit|3=de|code=y}}</tt>


<templatedata>{
== See also ==
"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.",
{{Commons:Link templates/Template links}}
"params": {
  "1": {
    "label": "template name",
    "description": "the template name without the namespace prefix “Template:”, which is added automatically",
    "type": "string",
    "required": true
  }
}}</templatedata>
 
More complex variations are described below.
 
==Example==
{| 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>[http://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==
{{Tl-nav}}


<includeonly>
<includeonly>
[[Category:Internal link templates]]
[[Category:Typing-aid templates|{{PAGENAME}}]]
 
[[Category:Internal link templates|{{PAGENAME}}]]
[[Category:Interwiki link templates|{{PAGENAME}}]]
</includeonly>
</includeonly>

Latest revision as of 17:14, 7 May 2015

For the Tagalog language template, see {{tgl}}

Tl stands for Template link. It creates a link to a template and surrounds it with {{...}}.

Usage

{{Tl/doc |2= |3= |1= }}

⧼templatedata-doc-params⧽

ParameterDescriptionDefaultStatus
2display nameparameter 1optional
3interwiki language code (can also be specified with lang=)emptyoptional
codeany value, for a sourrounding <code> tag  (like {{Tl2}})emptyoptional
inclnumeric value,
  • 0: both brackets are not a part of the link,  like {{Tl}}
  • 1: the inner brackets are part of the link  like {{T1}}
  • 2: both brackets are part of the link,  like {{T}}
0optional
parmto display templates parameters   (like {{Tlx}})
e.g."parm=&#124;1=&#124;2=&#124;code=y"
gives "|1=|2=|code=y"
emptyoptional
1template nameTloptional

Additional information

The template is intended to be used in the following namespaces: no namespace specified

The template is intended to be used by the following user groups: no user group specified

Examples

  • {{Tl}} → {{[[Template:{{{1}}}|{{{1}}}]]}}
  • {{Tl|coltit}} → {{coltit}}
  • {{Tl|coltit|incl=0}} → {{coltit}}
  • {{Tl|coltit|incl=1}} → {{coltit}}
  • {{Tl|coltit|incl=2}} → {{coltit}}
  • {{Tl|Coltit|coltit}} → {{Coltit}}
  • {{Tl|Coltit|test|en}} → {{Coltit}}
  • {{Tl|Coltit|3=de}} → {{Coltit}}

with code=y

  • {{Tl|U|user|code=y|parm=&#124;1=&#124;2=&#124;parameter=}} → {{U}}
  • {{Tl|coltit|code=y}} → {{coltit}}
  • {{Tl|Coltit|coltit|code=y|incl=1}} → {{Coltit}}
  • {{Tl|Coltit|color titling|en|code=y}} → {{Coltit}}
  • <tt>{{Tl|Coltit|3=de|code=y}}</tt> → {{Coltit}}

See also

{{Commons:Link templates/Template links}}