Template:Template link expanded with subst: Difference between revisions
(Created page with "Template:Template link expanded with subst") |
No edit summary |
||
Line 1: | Line 1: | ||
{{#Invoke:Template link general|main|code=on|subst=on}}<noinclude> | |||
{{Documentation|1=Template:Tlg/doc | |||
|content = {{tlg/doc|tlxs}} | |||
}} | |||
<!-- Add categories to the /doc subpage, not here! --> | |||
</noinclude> |
Latest revision as of 14:01, 5 August 2022
{{subst:Template:Template link expanded with subst}}
This template uses Lua: |
This template, often abbreviated as {{tlxs}}, is used to provide stylized formatting to template displays without actually using the template itself.
Parameters
With the exception of Template:Mono, 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) | Template:Tlg | ||
brace | Include braces as part of the template link | Template:Tlg | {{tlw}}/{{tn}} |
braceinside | Include innermost braces as part of the template link | Template:Tlg | |
bold | Renders the template link/name in bold | Template:Tlg | {{tlb}}, {{tlxb}} |
code | Display output using HTML
<code>...</code> tags (monospaced font) || Template:Tlg || {{tlc}}, {{Template link expanded}}, etc.
| ||
italic | Display any parameters accompanying the template link/name in italics | Template:Tlg | {{tlxi}} |
kbd | Display output using HTML
<kbd>...</kbd> tags (monospaced font) || Template:Tlg ||
| ||
nolink | Don't render the template name as a link | Template:Tlg | {{tlf}}, {{tnull}} |
nowrap | Prevent the insertion of line breaks (word wrap) in the output | Template:Tlg | |
nowrapname | Prevent word wrapping in the output of template name/link (parameters will wrap if needed) | Template:Tlg | |
plaincode | Uses
| ||
subst | Include a subst: prefix before the template link/name | Template:Tlg | {{tls}}, {{tlxs}}, etc |
|alttext=[text] |
Use [text] as the label for the template link | Template:Tlg | {{tla}} |
_show_result | Will also display the result of the template. | {{Min|7|-5}} |
|
_expand | Will add a link to the expanded template page. | {{Min|7|-5}} |
Unnamed (Positional)
This template can take any number of unnamed parameters as parameters accompanying the template link (or name); see Examples below.
Examples
- 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.
Code | Output | Remarks |
{{tlxs|Banner}} | Template:Tlxs | Banner template does not exist. Be aware with linking to non-existing templates, although desired. |
{{tlxs|ok}} | Template:Tlxs | ok template does exist |
{{tlxs|convert|<nowiki>14|m|ftin|abbr=out|sp=us</nowiki>}} | Template:Tlxs | Unlimited parameters as one
<nowiki>...</nowiki> string |
{{tlxs|Abc}} | Template:Tlxs | |
{{tlxs|abC}} | Template:Tlxs | template names are case-sensitive |
{{tlxs|abc}} | Template:Tlxs | first letter is case-insensitive though |
{{tlxs|abc|{{spaces}}tlxs{{spaces}}}} | Template:Tlxs | Using {{spaces}} before and after {{{1}}} parameter. |
{{tlxs|x0}} | Template:Tlxs | |
{{tlxs|x0|codeError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on}} | Template:Tlxs | <code> style |
{{tlxs|x0|plaincodeError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on}} | Template:Tlxs | plaincode style |
{{tlxs|x0|kbdError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on}} | Template:Tlxs | <kbd> style |
{{tlxs|x0|boldError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on}} | Template:Tlxs | bold link/name |
{{tlxs|x1|one|italicError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on}} | Template:Tlxs | parameter/s in italics |
{{tlxs|x0|nolinkError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on}} | Template:Tlxs | |
{{tlxs|x0|substError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on}} | Template:Tlxs | |
{{tlxs|x0|braceError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on}} | Template:Tlxs | all braces in link |
{{tlxs|x0|braceinsideError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on}} | Template:Tlxs | inside braces in link |
{{tlxs|x0|alttextError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.x0 link}} | Template:Tlxs | |
{{tlxs|x0|boldError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on|codeError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on|braceError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on}} | Template:Tlxs | No reason you can't combine multiple parameter settings |
{{tlxs|x1|one}} | Template:Tlxs | |
{{tlxs|x2|one|two}} | Template:Tlxs | |
{{tlxs|x2|boldError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on|codeError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on|one|two}} | Template:Tlxs | Can combine named and anonymous parameters … |
{{tlxs|x2|one|two|boldError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on|codeError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on}} | Template:Tlxs | … in any order … |
{{tlxs|x2|one|codeError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on|two|boldError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on|three}} | Template:Tlxs | … even intermixed … |
{{tlxs|x2|one|codeError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on|two|boldError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on|three|italicError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on}} | Template:Tlxs | … with many different configurations. |
{{tlxs|x3|1|2|3|4|5|6|7|8|9|…}} | Template:Tlxs | |
{{tlxs}} | tlxs | with no arguments, the current page name is substituted |
{{tlxs|x1|x=u}} | Template:Tlxs | Error: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character. won't work |
{{tlxs|x1|x=u}} | Template:Tlxs | = is okay |
{{tlxs|x1|x{{=}}u}} | Template:Tlxs | {{=}} is okay (see template equal sign) |
{{tlxs|x1|x<nowiki>=</nowiki>u}} | Template:Tlxs | sticky nowiki is okay |
{{tlxs|x2||two||}} | Template:Tlxs | empty parameters work too, even at the end |
{{tlxs|x2|3=two|2=one}} | Template:Tlxs | right to left okay |
Code | Output |
---|---|
{{tlxs|long template name that would wrap to new line|this is a long value for the 1st parameter that would wrap}}
|
Template:Tlxs |
Code | Output |
---|---|
{{tlxs|nowrapError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}}
|
Template:Tlxs |
Code | Output |
---|---|
{{tlxs|nowrapnameError: The retired template Template:Tn has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code Template:Magic word to generate the = character.on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}}
|
Template:Tlxs |
See also
Template:Template-linking templates Template:Semantic markup templates