Template:Template link general/doc: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
m
(High use)
 
(19 intermediate revisions by 12 users not shown)
Line 1:
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE -->
{{#ifeq:{{FULLPAGENAME}}|Template:Template link expanded|{{used in system}}}}|
{{#ifexpr:{{#invoke:Transclusion count|fetch|0}} > 2000|{{high-use}}}}}}
{{#ifeq:{{FULLPAGENAME}}|Template:Template link expanded|{{used in system}}}}
{{tsh|{{{1|tlg}}}|{{{2|}}}}}
{{lua|Module:TlgTemplate link general}}
 
This template, often abbreviated as {{tlf|{{#switch:{{lc:{{ROOTPAGENAME}}}}
Line 19:
| tls | template link with subst = tls
| tnull | template link null = tnull
| tlc | template link code = tlc
| tlp | template link with parameters = tlp}}
}}, is used to provide stylized linksformatting to templatestemplate displays without expandingactually using the template itself.
 
===Parameters===
Line 27 ⟶ 26:
 
{| class="wikitable"
! Parameter || Action || Use with<br>{{t|example}} || Default active
|-
| braceinsidebrace || Include innermost braces as part of the template link || {{tlg|brace=yes|example}} || {{tl|tlw}}/{{tl|tn}}
|-
| bracebraceinside || Include innermost braces as part of the template link || {{tltlg|tlw}}/{{tlexample|tnbraceinside=yes}} ||
|-
| bold || Renders the template link/name in '''bold''' || {{tlg|bold=yes|example}} || {{tl|tlb}}, {{tl|tlxb}}
| braceinside || Include innermost braces as part of the template link ||
|-
| kbdcode || Display output using HTML [[HTML element#kbdcode|{{tag|kbdcode}}]] tags ([[monospaced font]]) || {{tlg|code=yes|example}} || {{tl|tlc}}, {{tl|Template link expanded}}, etc.
| bold || Renders the template link/name in '''bold''' || {{tl|tlb}}, {{tl|tlxb}}
|-
| codeitalic || Display outputany usingparameters HTMLaccompanying [[HTMLthe element#code|{{tag|code}}]]template tagslink/name ([[monospacedin font]])''italics'' ||| {{tltlg|italic=yes|example|tlcparam}}, || {{tl|tlxtlxi}}, etc.
|-
| italickbd || Display anyoutput parametersusing accompanyingHTML the[[HTML templateelement#kbd|{{tag|kbd}}]] link/nametags in(monospaced ''italics''font) || {{tltlg|tlxikbd=yes|example}} ||
|-
| nolink || Don't render the template name as a link || {{tlg|nolink=yes|example}} || {{tl|tlf}}, {{t|tnull}}
| kbd || Display output using HTML [[HTML element#kbd|{{tag|kbd}}]] tags (monospaced font) ||
|-
| nolinknowrap || Don't renderPrevent the templateinsertion nameof asline abreaks link([[word wrap]]) in the output || {{tltlg|tlf}}, {{tnowrap=yes|tlcexample}}, {{t|tnull}}|
|-
| nowrapnowrapname || Prevent word wrapping in the insertionoutput of linetemplate breaksname/link ([[wordparameters will wrap]]) inif theneeded) output|| {{tlg|nowrapname=yes|example}} ||
|-
| plaincode || Uses {{tag|code|params=style="border:none; background:transparent;"}} || {{tlg|plaincode=yes|example}} || {{tl|tltss}}
| nowrapname || Prevent word wrapping in the output of template name/link (parameters will wrap if needed) ||
|-
| subst || Include a [[Help:Substitution|subst:]] prefix before the template link/name || {{tlg|subst=yes|example}} || {{tl|tls}}, {{tl|tlxs}}, etc
| plaincode || Uses {{tag|code|params=style="border:none; background:transparent;"}} || {{tl|tltss}}
|-
| subst{{para|alttext|[text]}} || Include aUse [[Help:Substitution|subst:]text] prefixas beforethe label for the template link/name || {{tltlg|alttext=Other|tlsexample}}, || {{tl|tlxstla}}, etc
|-
| {{para|alttext|[text]}}_show_result || UseWill [text]also asdisplay the labelresult forof the template link . || {{tltlx|tlaMin|7|-5|_show_result=y}} ||
|}
 
====Unnamed (Positional)====
This template takescan uptake toany tennumber of [[unnamed parameter]]s as parameters accompanying the template link (or name); see Examples below.
 
===Examples===
Line 66 ⟶ 67:
|style=background-color:transparent;<!-- to see background of <code>...</code> -->
| '''Code''' | '''Output''' | '''Remarks'''
| {{tlx|{{{1|tlg}}}|TermometroBanner}} | {{{{{1|tlg}}}|TermometroBanner}} | {{error|TermometroBanner}} template does not exist. Be aware with linking to non-existing templates, although desired.
| {{tlx|{{{1|tlg}}}|ok}} | {{{{{1|tlg}}}|ok}} | ok template does exist
| {{tlx|{{{1|tlg}}}|convert|<nowiki>&lt;nowiki>14|m|ftin|abbr=out|sp=us&lt;/nowiki></nowiki>}} | {{{{{1|tlg}}}|convert|<nowiki>14|m|ftin|abbr=out|sp=us</nowiki>}} | Unlimited parameters as one {{tag|nowiki|link=yes}} [[Help:Wikitext#Nowiki|string]]
Line 92 ⟶ 93:
| {{tlx|{{{1|tlg}}}|x2|one|code{{=}}on|two|bold{{=}}on|three|italic{{=}}on}} | {{{{{1|tlg}}}|x2|one|code=on|two|bold=on|three|italic=on}} | … with many different configurations.
| {{tlx|{{{1|tlg}}}|x3|1|2|3|4|5|6|7|8|9|10}} | {{{{{1|tlg}}}|x3|1|2|3|4|5|6|7|8|9|10}} |
| {{tlx|{{{1|tlg}}}|x4|1|2|3|4|5|6|7|8|9|10|11}} | {{{{{1|tlg}}}|x4|1|2|3|4|5|6|7|8|9|10|11}} | up to 10 parameters, then …
| {{tlx|{{{1|tlg}}}|x5|1|2|3|4|5|6|7|8|9|10&amp;#124;11}} | {{{{{1|tlg}}}|x5|1|2|3|4|5|6|7|8|9|10&#124;11}} | {{align|right|<code>&amp;#124;</code> for more}}
| {{tlx|{{{1|tlg}}}}} | {{{1|tlg}}} | with no arguments, the current page name is substituted
| {{tlx|{{{1|tlg}}}|x1|x&#61;u}} | {{{{{1|tlg}}}|x1|x=u}} | '''{{=}}''' won't work
Line 103 ⟶ 102:
}}
 
{| class="wikitable" |style="border:1; cellpadding:4; background-color:transparent;"
|+ style="text-align:left;" | Wrapping of long names (default)
|-
Line 113 ⟶ 112:
|}
 
{| class="wikitable" |style="border:1; cellpadding:4; background-color:transparent;"
|+ style="text-align:left;" | Wrapping of long names (<kbd>nowrap=on</kbd>)
|-
Line 123 ⟶ 122:
|}
 
{| class="wikitable" |style="border:1; cellpadding:4; background-color:transparent;"
|+ style="text-align:left;" | Wrapping of long names (<kbd>nowrapname=on</kbd>)
|-
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu