Toggle search
Search
Toggle menu
notifications
Toggle personal menu
Editing
Template:Template link general/doc
Template page
Views
Read
Edit source
View history
associated-pages
Template
Discussion
More actions
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.
Anti-spam check. Do
not
fill this in!
{{Documentation subpage}} <!-- PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE --> {{#ifeq:{{FULLPAGENAME}}|Template:Template link with subst|{{used in system}}| {{#ifexpr:{{#invoke:Transclusion count|fetch|0}} > 2000|{{high-use}}}}}} {{tsh|{{{1|tlg}}}|{{{2|}}}}} {{lua|Module:Template link general}} 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. The code generated will be displayed inline. For a multi-line output, see {{tl|Tj}}. ===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 (see Examples below). Certain templates have the parameter "on" by default; see the main table for all alternate options. {| class="wikitable" ! Parameter || Action || Use with<br>{{tl|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 {{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 {{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}}, {{tl|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 subst: prefix before the template link/name || {{tlg|subst=yes|example}} || {{tl|tls}}, {{tl|tlxs}}, etc |- | alttext=<code style="padding:0; margin:0">[text]</code> || Replace <code style="padding:0; margin:0">[text]</code> with the actual label to be displayed 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}} || |} ====Unnamed (Positional)==== This template can take any number of unnamed parameters as parameters accompanying the template link (or name); see Examples below. ===Examples=== {{#switch:{{SITENAME}} |Wikipedia|Meta= | ; Note: On the source sister projects, en.wikipedia and Meta, '''X0, X1, X2, ..., X9 are sandbox templates''' for experimentation on involved templates that need be in template space. An auto-cleansing software facility exists that might be used to duplicate the facility on other Sister projects. }} {{Aligned table |cols=3 |class=wikitable |style=background-color:transparent;<!-- to see background of <code>...</code> --> | '''Code''' | '''Output''' | '''Remarks''' | {{tji|{{{1|tlg}}}|Banner}} | {{{{{1|tlg}}}|Banner}} | Template:Banner does not exist. (Non-existent template is redlinked.) | {{tji|{{{1|tlg}}}|Abc}} | {{{{{1|tlg}}}|Abc}} | Template:Abc exists. | {{tji|{{{1|tlg}}}|abC}} | {{{{{1|tlg}}}|abC}} | Template names are case-sensitive | {{tji|{{{1|tlg}}}|abc}} | {{{{{1|tlg}}}|abc}} | (but the first letter is case-insensitive). | {{tji|{{{1|tlg}}}|x0}} | {{{{{1|tlg}}}|x0}} | no parameters | {{tji|{{{1|tlg}}}|x1|one}} | {{{{{1|tlg}}}|x1|one}} | one parameter | {{tji|{{{1|tlg}}}|x2|one|two}} | {{{{{1|tlg}}}|x2|one|two}} | two parameters | {{tji|{{{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}} | ten parameters | <syntaxhighlight lang="wikitext" inline>{{tlg|convert|<nowiki>14|m|ftin|abbr=out|sp=us</nowiki>}}</syntaxhighlight> | {{{{{1|tlg}}}|convert|<nowiki>14|m|ftin|abbr=out|sp=us</nowiki>}} | Unlimited parameters, as one {{tag|nowiki|link=yes}} string. | {{tji|{{{1|tlg}}}|x2||two||}} | {{{{{1|tlg}}}|x2||two||}} | Empty parameters are discarded. | {{tji|{{{1|tlg}}}|x0|code: on}} | {{{{{1|tlg}}}|x0|code=on}} | <code> style | {{tji|{{{1|tlg}}}|x0|plaincode: on}} | {{{{{1|tlg}}}|x0|plaincode=on}} | plaincode style | {{tji|{{{1|tlg}}}|x0|kbd: on}} | {{{{{1|tlg}}}|x0|kbd=on}} | <kbd> style | {{tji|{{{1|tlg}}}|x0|bold: on}} | {{{{{1|tlg}}}|x0|bold=on}} | bold link/name | {{tji|{{{1|tlg}}}|x1|one|italic: on}} | {{{{{1|tlg}}}|x1|one|italic=on}} | parameter(s) in italics | {{tji|{{{1|tlg}}}|x0|nolink: on}} | {{{{{1|tlg}}}|x0|nolink=on}} | | {{tji|{{{1|tlg}}}|x0|subst: on}} | {{{{{1|tlg}}}|x0|subst=on}} | | {{tji|{{{1|tlg}}}|x0|brace: on}} | {{{{{1|tlg}}}|x0|brace=on}} | all braces in link | {{tji|{{{1|tlg}}}|x0|braceinside: on}} | {{{{{1|tlg}}}|x0|braceinside=on}} | inside braces in link | {{tji|{{{1|tlg}}}|x0|alttext: x0 link}} | {{{{{1|tlg}}}|x0|alttext=x0 link}} | | {{tji|{{{1|tlg}}}|x0|bold: on|code: on|brace: on}} | {{{{{1|tlg}}}|x0|bold=on|code=on|brace=on}} | Combine multiple parameter settings. | <syntaxhighlight lang="wikitext" inline>{{tlg|x1|{{spaces}}one{{spaces}}}}</syntaxhighlight> | {{{{{1|tlg}}}|abc|{{spaces}}one{{spaces}}}} | Using {{tl|spaces}} before and after a parameter. | {{tji|{{{1|tlg}}}|x2|bold: on|code: on|one|two}} | {{{{{1|tlg}}}|x2|bold=on|code=on|one|two}} | Can combine named and anonymous parameters ... | {{tji|{{{1|tlg}}}|x2|one|two|bold: on|code: on}} | {{{{{1|tlg}}}|x2|one|two|bold=on|code=on}} | ... in any order ... | {{tji|{{{1|tlg}}}|x2|one|code: on|two|bold: on|three}} | {{{{{1|tlg}}}|x2|one|code=on|two|bold=on|three}} | ... even intermixed ... | {{tji|{{{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 configurations. | <syntaxhighlight lang="wikitext" inline>{{tlg|x1|x=u}}</syntaxhighlight> | {{{{{1|tlg}}}|x1|x=u}} | '''{{=}}''' won't work | <syntaxhighlight lang="wikitext" inline>{{tlg|x1|x=u}}</syntaxhighlight> | {{{{{1|tlg}}}|x1|x=u}} | <code>&#61;</code> is okay | <syntaxhighlight lang="wikitext" inline>{{tlg|x1|x{{=}}u}}</syntaxhighlight> | {{{{{1|tlg}}}|x1|x{{=}}u}} | <code><nowiki>{{=}}</nowiki></code> is okay (see [[:Template:=|Template:=]]) | <syntaxhighlight lang="wikitext" inline>{{tlg|x1|x<nowiki>=</nowiki>u}}</syntaxhighlight> | {{{{{1|tlg}}}|x1|x<nowiki>=</nowiki>u}} | Sticky nowiki is okay. | {{tji|{{{1|tlg}}}|x2|3: two|2: one}} | {{{{{1|tlg}}}|x2|3=two|2=one}} | {{align|right|Right-to-left is okay}} | {{tji|{{{1|tlg}}}}} | {{{1|tlg}}} | With no arguments, it emits the current page name without braces. | {{tji|{{{1|tlg}}}|x2|3: one|4: two}} | {{{{{1|tlg}}}|x2|3=one|4=two}} | Null parameter stops parsing. }} {| class="wikitable" |style="background-color:transparent;" |+ style="text-align:left;" | Wrapping of long names (default) |- ! Code ! style="width:15em;" | Output |- | {{tji|{{{1|tlg}}}|long template name that would wrap to new line|this is a long value for the 1st parameter that would wrap}} | {{{{{1|tlg}}}|long template name that would wrap to new line|this is a long value for the 1st parameter that would wrap}} |} {| class="wikitable" |style="background-color:transparent;" |+ style="text-align:left;" | Wrapping of long names (<kbd>nowrap=on</kbd>) |- ! Code ! style="width:15em;" | Output |- | {{tji|{{{1|tlg}}}|nowrap: on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}} | {{{{{1|tlg}}}|nowrap=on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}} |} {| class="wikitable" |style="background-color:transparent;" |+ style="text-align:left;" | Wrapping of long names (<kbd>nowrapname=on</kbd>) |- ! Code ! style="width:15em;" | Output |- | {{tji|{{{1|tlg}}}|nowrapname: on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}} | {{{{{1|tlg}}}|nowrapname=on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}} |} ==See also== {{Template-linking templates}} {{Semantic markup templates}} <includeonly>{{Sandbox other| | <!-- CATEGORIES BELOW THIS LINE, PLEASE: --> [[Category:Internal template-link templates]] [[Category:Wikitext typing-aid templates]] }}</includeonly>
Summary:
Please note that all contributions to W.K.pedia are considered to be released under the Creative Commons Attribution-ShareAlike (see
awk: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!
Cancel
Editing help
(opens in new window)
Template:((
(
edit
)
Template:))
(
edit
)
Template:Align
(
edit
)
Template:Aligned table
(
edit
)
Template:Braces
(
edit
)
Template:Button
(
edit
)
Template:C
(
edit
)
Template:Clear
(
edit
)
Template:Code
(
edit
)
Template:Codett
(
edit
)
Template:Colon
(
edit
)
Template:Demo
(
edit
)
Template:Documentation subpage
(
edit
)
Template:Dtl
(
edit
)
Template:Elc
(
edit
)
Template:Em
(
edit
)
Template:Hatnote
(
edit
)
Template:Hlist/styles.css
(
edit
)
Template:Ifsubst
(
edit
)
Template:Kbd
(
edit
)
Template:Key press
(
edit
)
Template:Key press/styles.css
(
edit
)
Template:Key top
(
edit
)
Template:Lt
(
edit
)
Template:Lts
(
edit
)
Template:Lua
(
edit
)
Template:Lx
(
edit
)
Template:Magic word
(
edit
)
Template:Main other
(
edit
)
Template:Mbox
(
edit
)
Template:Min
(
edit
)
Template:Ml
(
edit
)
Template:Ml-lua
(
edit
)
Template:Mlx
(
edit
)
Template:Module link
(
edit
)
Template:Module link expanded
(
edit
)
Template:Module link lua
(
edit
)
Template:Mono
(
edit
)
Template:Mono/styles.css
(
edit
)
Template:N/a
(
edit
)
Template:Navbar
(
edit
)
Template:Navbox
(
edit
)
Template:No redirect
(
edit
)
Template:NoteFoot
(
edit
)
Template:NoteTag
(
edit
)
Template:Nowrap
(
edit
)
Template:Para
(
edit
)
Template:Param
(
edit
)
Template:Param value
(
edit
)
Template:ParserFunction
(
edit
)
Template:Pf
(
edit
)
Template:Plainlist/styles.css
(
edit
)
Template:Pvalue
(
edit
)
Template:Reflist
(
edit
)
Template:Reflist/styles.css
(
edit
)
Template:Replace
(
edit
)
Template:Resize
(
edit
)
Template:Samp
(
edit
)
Template:Sclx
(
edit
)
Template:Semantic markup templates
(
edit
)
Template:Small
(
edit
)
Template:Smaller
(
edit
)
Template:Spaces
(
edit
)
Template:Strong
(
edit
)
Template:Strongbad
(
edit
)
Template:Stronggood
(
edit
)
Template:T links
(
edit
)
Template:Tag
(
edit
)
Template:Template-linking templates
(
edit
)
Template:Template journal
(
edit
)
Template:Template journal/arg
(
edit
)
Template:Template journal/styles.css
(
edit
)
Template:Template journal inline
(
edit
)
Template:Template journal inline/arg
(
edit
)
Template:Template journal inline/styles.css
(
edit
)
Template:Template journal parameter
(
edit
)
Template:Template link
(
edit
)
Template:Template link code
(
edit
)
Template:Template link expanded
(
edit
)
Template:Template link expanded with bold
(
edit
)
Template:Template link expanded with italic
(
edit
)
Template:Template link expanded with subst
(
edit
)
Template:Template link general
(
edit
)
Template:Template link normal
(
edit
)
Template:Template link null
(
edit
)
Template:Template link universal
(
edit
)
Template:Template link universal expanded
(
edit
)
Template:Template link universal with subst
(
edit
)
Template:Template link with alternate text
(
edit
)
Template:Template link with bold
(
edit
)
Template:Template link with link off
(
edit
)
Template:Template link with linked braces
(
edit
)
Template:Template link with parameters
(
edit
)
Template:Template link with subst
(
edit
)
Template:Template link with title with subst
(
edit
)
Template:Template shortcut
(
edit
)
Template:Terminate sentence
(
edit
)
Template:Tetl
(
edit
)
Template:Tfd links
(
edit
)
Template:Thin space
(
edit
)
Template:Ti
(
edit
)
Template:Tic
(
edit
)
Template:Tim
(
edit
)
Template:Tiw
(
edit
)
Template:Tj
(
edit
)
Template:Tj/arg
(
edit
)
Template:Tji
(
edit
)
Template:Tji/arg
(
edit
)
Template:Tjp
(
edit
)
Template:Tl
(
edit
)
Template:Tl2
(
edit
)
Template:Tla
(
edit
)
Template:Tlb
(
edit
)
Template:Tlc
(
edit
)
Template:Tld
(
edit
)
Template:Tlf
(
edit
)
Template:Tlg
(
edit
)
Template:Tln
(
edit
)
Template:Tlp
(
edit
)
Template:Tls
(
edit
)
Template:Tlsc
(
edit
)
Template:Tlsf
(
edit
)
Template:Tlsu
(
edit
)
Template:Tlt
(
edit
)
Template:Tltss
(
edit
)
Template:Tlu
(
edit
)
Template:Tlx
(
edit
)
Template:Tlxb
(
edit
)
Template:Tlxi
(
edit
)
Template:Tlxs
(
edit
)
Template:Tlxu
(
edit
)
Template:Tn
(
edit
)
Template:Tnull
(
edit
)
Template:Trim
(
edit
)
Template:Tsetl
(
edit
)
Template:Tsh
(
edit
)
Template:Ttl
(
edit
)
Template:Twlh
(
edit
)
Template:Var
(
edit
)
Template:Var serif
(
edit
)
Template:Var serif/styles.css
(
edit
)
Template:WikiData template link
(
edit
)
Template:Xtag
(
edit
)
Template:Yesno
(
edit
)
Module:Aligned table
(
edit
)
Module:Arguments
(
edit
)
Module:Check for unknown parameters
(
edit
)
Module:Demo
(
edit
)
Module:Hatnote
(
edit
)
Module:Hatnote/styles.css
(
edit
)
Module:Key
(
edit
)
Module:List
(
edit
)
Module:Lua banner
(
edit
)
Module:Math
(
edit
)
Module:Message box
(
edit
)
Module:Message box/configuration
(
edit
)
Module:Message box/ombox.css
(
edit
)
Module:Navbar
(
edit
)
Module:Navbar/configuration
(
edit
)
Module:Navbar/styles.css
(
edit
)
Module:Navbox
(
edit
)
Module:Navbox/configuration
(
edit
)
Module:Navbox/styles.css
(
edit
)
Module:Redirect
(
edit
)
Module:Separated entries
(
edit
)
Module:Shortcut
(
edit
)
Module:Shortcut/config
(
edit
)
Module:Shortcut/styles.css
(
edit
)
Module:String
(
edit
)
Module:TableTools
(
edit
)
Module:Template link general
(
edit
)
Module:Text
(
edit
)
Module:Tfd links
(
edit
)
Module:Transclusion count
(
edit
)
Module:Transclusion count/data/T
(
edit
)
Module:Yesno
(
edit
)
Search for pages containing