Template:Template link code: Difference between revisions

Template page
(Created page with "<includeonly>{{#Invoke:Template link general|main|nolink=yes|code=yes|nowrap=yes}}</includeonly><noinclude> {{Template:Template link general/doc}} <!-- Add categories to the /doc subpage, not here! --> </noinclude>")
 
No edit summary
 
Line 1: Line 1:
<includeonly>{{#Invoke:Template link general|main|nolink=yes|code=yes|nowrap=yes}}</includeonly><noinclude>
{{Documentation}}
{{Template:Template link general/doc}}
{{Wikipedia template}}
<!-- Add categories to the /doc subpage, not here! -->
 
</noinclude>
{{tsh|{{{1|tlg}}}|{{{2|}}}}}
 
This template, often abbreviated as {{tlf|{{#switch:{{lc:{{ROOTPAGENAME}}}}
| tlg | template link general = tlg
| tlb | template link with bold = tlb
| tlc | template link code = tlc
| tlw ||template link with linked braces = tlw
| tlf | template link with link off = tlf
| tltss | template link with title span, subst = tltss
| tlx | template link expanded = tlx
| tlxb | template link expanded with bold = tlxb
| tlxi | template link expanded with italic = tlxi
| tlxs | template link expanded with subst = tlxs
| tls | template link with subst = tls
| tnull | template link null = tnull
| tlp | template link with parameters = tlp}}
}}, is used to provide stylized formatting to template displays without actually using the template itself.
 
===Parameters===
With the exception of {{mono|alttext}}, the named parameters are toggles that are either omitted (default in most cases) or activated (by being assigned a value such as "on", "yes", "true", "include", etc.). They may be included in any order ([[#Examples|see Examples below]]). Certain templates have the parameter "on" by default; see [[#General-purpose formatting|the main table]] for all alternate options.
 
{| class="wikitable"
! Parameter || Action || Use with<br>{{t|example}} || Default active
|-
| || Default (without accessory parameters) || {{tlg|example}} ||
|-
| brace || Include braces as part of the template link || {{tlg|brace=yes|example}} || {{tl|tlw}}/{{tl|tn}}
|-
| braceinside || Include innermost braces as part of the template link || {{tlg|example|braceinside=yes}} ||
|-
| bold || Renders the template link/name in '''bold''' || {{tlg|bold=yes|example}} || {{tl|tlb}}, {{tl|tlxb}}
|-
| code || Display output using HTML [[HTML element#code|{{tag|code}}]] tags ([[monospaced font]]) || {{tlg|code=yes|example}} || {{tl|tlc}}, {{tl|Template link expanded}}, etc.
|-
| italic || Display any parameters accompanying the template link/name in ''italics'' ||| {{tlg|italic=yes|example|param}} || {{tl|tlxi}}
|-
| kbd || Display output using HTML [[HTML element#kbd|{{tag|kbd}}]] tags (monospaced font) || {{tlg|kbd=yes|example}} ||
|-
| nolink || Don't render the template name as a link || {{tlg|nolink=yes|example}} || {{tl|tlf}}, {{t|tnull}}
|-
| nowrap || Prevent the insertion of line breaks ([[word wrap]]) in the output || {{tlg|nowrap=yes|example}} ||
|-
| nowrapname || Prevent word wrapping in the output of template name/link (parameters will wrap if needed) || {{tlg|nowrapname=yes|example}} ||
|-
| plaincode || Uses {{tag|code|params=style="border:none; background:transparent;"}} || {{tlg|plaincode=yes|example}} || {{tl|tltss}}
|-
| subst || Include a [[Help:Substitution|subst:]] prefix before the template link/name || {{tlg|subst=yes|example}} || {{tl|tls}}, {{tl|tlxs}}, etc
|-
| {{para|alttext|[text]}} || Use [text] as the label for the template link  || {{tlg|alttext=Other|example}} || {{tl|tla}}
|-
| _show_result || Will also display the result of the template. || {{tlx|Min|7|-5|_show_result=y}} ||
|-
| _expand || Will add a link to the expanded template page. || {{tlx|Min|7|-5|_expand=y}} ||
|}
 
<includeonly>
<!-- Category -->
[[Category:Internal link templates]]
[[Category:Typing-aid templates]]
</includeonly>

Latest revision as of 17:35, 3 July 2023

Template documentation[view][edit][history][purge]
This documentation is transcluded from Template:Template link code/doc. Changes can be proposed in the talk page.
Template documentation[view][edit][history][purge]
This documentation is transcluded from Template:Template link code/doc. Changes can be proposed in the talk page.

This template is used to indicate a template is imported from English Wikipedia. It should be placed at the top of the template documentation page.

This template, often abbreviated as Template:Tlf, is used to provide stylized formatting to template displays without actually using the template itself.

Parameters

With the exception of alttext, the named parameters are toggles that are either omitted (default in most cases) or activated (by being assigned a value such as "on", "yes", "true", "include", etc.). They may be included in any order (see Examples below). Certain templates have the parameter "on" by default; see the main table for all alternate options.

Parameter Action Use with
{{example}}
Default active
Default (without accessory parameters) {{example}}
brace Include braces as part of the template link {{example}} {{tlw}}/{{tn}}
braceinside Include innermost braces as part of the template link {{example}}
bold Renders the template link/name in bold {{example}} {{tlb}}, {{tlxb}}
code Display output using HTML [[HTML element#code|Template:Tag]] tags (monospaced font) {{example}} {{tlc}}, {{Template link expanded}}, etc.
italic Display any parameters accompanying the template link/name in italics {{example|param}} {{tlxi}}
kbd Display output using HTML [[HTML element#kbd|Template:Tag]] tags (monospaced font) {{example}}
nolink Don't render the template name as a link {{example}} {{tlf}}, {{tnull}}
nowrap Prevent the insertion of line breaks (word wrap) in the output {{example}}
nowrapname Prevent word wrapping in the output of template name/link (parameters will wrap if needed) {{example}}
plaincode Uses Template:Tag {{example}} {{tltss}}
subst Include a subst: prefix before the template link/name {{subst:example}} {{tls}}, {{tlxs}}, etc
Template:Para Use [text] as the label for the template link {{Other}} {{tla}}
_show_result Will also display the result of the template. Lua error: expandTemplate: template "Template:Min" does not exist.
_expand Will add a link to the expanded template page. {{Min|7|-5}} [1]