Template:Template link with subst
{{subst:Template:Template link with subst}}
| This template is used in system messages, and on approximately 52,000 pages. Changes to it can cause immediate changes to the Wikipedia user interface. To avoid major disruption, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. Please discuss changes on the talk page before implementing them. |
| This template uses Lua: |
This template, often abbreviated as {{tls}}, is used to provide stylized formatting to template displays without actually using the template itself. The code generated will be displayed inline.
Parameters
[kolera mu edit source]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. If a row renders identically to a previous row, it means the current template does not support that option and {{tlg}} needs to be used instead.
| Parameter | Action | Use with {{example}} | Default active |
|---|---|---|---|
| Default (without accessory parameters) | {{subst:example}} | ||
| brace | Include braces as part of the template link | {{subst:example}} | {{tlw}}/{{tn}} |
| braceinside | Include innermost braces as part of the template link | {{subst:example}} | |
| bold | Renders the template link/name in bold | {{subst:example}} | {{tlb}}, {{tlxb}} |
| code | Display output using HTML <code>...</code> tags (monospaced font) | {{subst:example}} | {{tlc}}, {{Template link expanded}}, etc. |
| italic | Display any parameters accompanying the template link/name in italics | {{subst:example|param}} | {{tlxi}} |
| kbd | Display output using HTML <kbd>...</kbd> tags (monospaced font) | {{subst: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 | {{subst:example}} | {{tlf}}, {{tlp}} |
| nowrapname | Prevent word wrapping in the output of template name/link (parameters will wrap if needed) | {{subst:example}} | |
| plaincode | Uses <code style="border:none; background:transparent;">...</code> | {{subst:example}} | {{tltss}} |
| subst | Include a subst: prefix before the template link/name | {{subst:example}} | {{tls}}, {{tlxs}}, etc |
alttext=[text] | Replace [text] with the actual label to be displayed for the template link | {{subst: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 | {{subst:Min|7|-5}} | |
| a | will add an asterisk before the template code | * {{subst:Min|7|-5}} |
Unnamed (Positional)
[kolera mu edit source]This template can take any number of unnamed parameters as parameters accompanying the template link (or name); see Examples below.
Examples
[kolera mu edit source]Use the displayed value in the code column, not the underlying source code.
| Code | Output | Remarks |
|---|---|---|
{{tls|Banner}} | {{subst:Banner}} | Template:Banner does not exist. (Non-existent template is redlinked.) |
{{tls|Abc}} | {{subst:Abc}} | Template:Abc exists. |
{{tls|abC}} | {{subst:abC}} | Template names are case-sensitive |
{{tls|abc}} | {{subst:abc}} | (but the first letter is case-insensitive). |
{{tls|x0}} | {{subst:x0}} | no parameters |
{{tls|x1|one}} | {{subst:x1|one}} | one parameter |
{{tls|x2|one|two}} | {{subst:x2|one|two}} | two parameters |
{{tls|x2|2=one=1|3=two=2}} | {{subst:x2|one=1|two=2}} | two parameters, assigned values |
{{tls|x3|1|2|3|4|5|6|7|8|9|10}} | {{subst:x3|1|2|3|4|5|6|7|8|9|10}} | ten parameters |
{{tls|convert|<nowiki>14|m|ftin|abbr=out|sp=us</nowiki>}} | {{subst:convert|14|m|ftin|abbr=out|sp=us}} | Unlimited parameters, as one <nowiki>...</nowiki> string. |
{{tls|x2|two}} | {{subst:x2|two}} | Empty parameters are discarded. |
{{tls|x0|code=on}} | {{subst:x0}} | <code> style |
{{tls|x0|plaincode=on}} | {{subst:x0}} | plaincode style |
{{tls|x0|kbd=on}} | {{subst:x0}} | <kbd> style |
{{tls|x0|bold=on}} | {{subst:x0}} | bold link/name |
{{tls|x1|one|italic=on}} | {{subst:x1|one}} | parameter(s) in italics |
{{tls|x0|nolink=on}} | {{x0}} | |
{{tls|x0|subst=on}} | {{subst:x0}} | |
{{tls|x0|brace=on}} | {{subst:x0}} | all braces in link |
{{tls|x0|braceinside=on}} | {{subst:x0}} | inside braces in link |
{{tls|x0|alttext=x0 link}} | {{subst:x0 link}} | |
{{tls|x0|bold=on|code=on|brace=on}} | {{subst:x0}} | Combine multiple parameter settings. |
{{tls|abc|{{spaces}}one{{spaces}}}} | {{subst:abc| one }} | Using {{spaces}} before and after a parameter. |
{{tls|x2|bold=on|code=on|one|two}} | {{subst:x2|one|two}} | Can combine named and anonymous parameters ... |
{{tls|x2|one|two|bold=on|code=on}} | {{subst:x2|one|two}} | ... in any order ... |
{{tls|x2|one|code=on|two|bold=on|three}} | {{subst:x2|one|two|three}} | ... even intermixed ... |
{{tls|x2|one|code=on|two|bold=on|three|italic=on}} | {{subst:x2|one|two|three}} | ... with many configurations. |
{{tls|x1|x=u}} | {{subst:x1}} | = won't work |
{{tls|x1|x=u}} | {{subst:x1|x=u}} | = is okay |
{{tls|x1|x{{=}}u}} | {{subst:x1|x=u}} | {{=}} is okay (see Template:=) |
{{tls|x1|2=x=u}} | {{subst:x1|x=u}} | Numbered parameter is okay |
{{tls|x1|x=u}} | {{subst:x1|x=u}} | Sticky nowiki is okay. |
{{tls|x2|3=two|2=one}} | {{subst:x2|one|two}} | Right-to-left is okay |
{{tls}} | tls | With no arguments, it emits the current page name without braces. |
{{tls|x2|3=one|4=two}} | {{subst:x2}} | Null parameter stops parsing. |
| Code | Output |
|---|---|
{{tls|long template name that would wrap to new line|this is a long value for the 1st parameter that would wrap}} |
{{subst:long template name that would wrap to new line|this is a long value for the 1st parameter that would wrap}} |
| Code | Output |
|---|---|
{{tls|nowrap=on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}} |
{{subst:long template name that would wrap to new line|long value for the 1st parameter that would wrap}} |
| Code | Output |
|---|---|
{{tls|nowrapname=on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}} |
{{subst:long template name that would wrap to new line|long value for the 1st parameter that would wrap}} |
TemplateData
[kolera mu edit source]TemplateData for Template link with subst
This template, often abbreviated as {{tlg}}, is used to provide stylized formatting to template displays without actually using the template itself. The code generated will be displayed inline.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Template name | 1 | no description | String | required |
| First parameter | 2 | First parameter of the template | Content | suggested |
| Second parameter | 3 | Second parameter of the template | Content | suggested |
| Third parameter | 4 | Third parameter of the template | Content | optional |
| Fourth parameter | 5 | Fourth parameter of the template | Content | optional |
| Fifth parameter | 6 | Fifth parameter of the template | Content | optional |
| Sixth parameter | 7 | Sixth parameter of the template | Content | optional |
| Seventh parameter | 8 | Seventh parameter of the template | Content | optional |
| Eigth parameter | 9 | Eigth parameter of the template | Content | optional |
| Ninth parameter | 10 | Ninth parameter of the template | Content | optional |
| brace | brace | Include braces as part of the template link | Boolean | optional |
| braceinside | braceinside | Include innermost braces as part of the template link | Boolean | optional |
| bold | bold | Renders the template link/name in bold | Boolean | optional |
| code | code | Display output using HTML <code>…</code> tags (monospaced font) | Boolean | optional |
| italic | italic | Display any parameters accompanying the template link/name in italics | Boolean | optional |
| kbd | kbd | Display output using HTML <kbd>...</kbd> tags (monospaced font) | Boolean | optional |
| nolink | nolink | Don't render the template name as a link | Boolean | optional |
| nowrap | nowrap | Prevent the insertion of line breaks (word wrap) in the output | Boolean | optional |
| nowrapname | nowrapname | Prevent word wrapping in the output of template name/link (parameters will wrap if needed) | Boolean | optional |
| plaincode | plaincode | Uses <code style="border:none; background:transparent;">...</code> | Boolean | optional |
| subst | subst | Include a subst: prefix before the template link/name | Boolean | optional |
| alttext | alttext | Label to be displayed for the template link | String | optional |
| _show_result | _show_result | Display the result of the template | Boolean | optional |
| _expand | _expand | Add a link to the expanded template page | Boolean | optional |
| a | a | Add an asterisk before the template code | Boolean | optional |
See also
[kolera mu edit source]Template:Template-linking templates Template:Semantic markup templates