模板:Tlx/doc
This template is used to show example template usage without expanding the template itself.
Basic use
(Note: In the following examples, ellipses (groups of three dots) indicate where parameters have been omitted.)
- {{tlx模板:\sandbox|tlx|Template|first parameter|second parameter|third|...|twentieth}} produces: {{tlx模板:\sandbox|Template|first parameter|second parameter|third|...|twentieth}}
Where parameters might contain one or more equals-signs ("="), replace each equals-sign with {{=}}:
- {{tlx模板:\sandbox|tlx|Template|first{{=}}something|second|third{{=}}something|...|twentieth}} produces: {{tlx模板:\sandbox|Template|first=something|second|third=something|...|twentieth}}
For more than ten parameters, possibly also containing equals-signs, use 模板:Tag thus:
- {{tlx模板:\sandbox|tlx|Template|<nowiki>''first''|''second''|''third=something''|...|''999th''</nowiki>}} produces: {{tlx模板:\sandbox|Template|first|second|third=something|...|999th}}
Purpose and naming
- If the only parameter supplied is 模板:Param, i.e. a template's name,
{{tlx}}'s output is the same as{{tl}}– i.e. a link within braces – but in a monospaced font:- 模板:Tc produces:
{{tl}}
- 模板:Tc produces: {{tlx模板:\sandbox|tl}}
{{tl}}will also not take nor display additional parameters.
- Named parameters
- Setting this parameter to any non-blank value will prefix the string
subst:linked to Help:Substitution. This is useful to indicate when a template should be substituted. For example, {{tlx模板:\sandbox|tlx|Welcome|3=subst=Y}} produces: {{tlx模板:\sandbox|Welcome|subst=Y}}. This is similar to the action of the {{tlx模板:\sandbox|tlxs}} template: {{tlx模板:\sandbox|tlxs|Welcome}} produces: 模板:Tlxs.
- For an interwiki link to other sister projects, such as: 模板:Para (Meta), 模板:Para (WikiQuote), 模板:Para (WikiSource), etc, facilitating interwiki template documentation and/or discussion.
- For a link to Wikipedias in other languages, such as: 模板:Para (German), 模板:Para (Swedish), etc, facilitating cross-language template documentation and/or discussion.
Documentation
{{Tlx}} is a generalization of
{{tl}},
{{tlp}} etc., with output that is arguably more legible. This depends on the browser, but narrow gaps between characters such as "模板:Thin space{模板:Thin space", "模板:Thin space|模板:Thin space", "模板:Thin space}模板:Thin space" and links can be hard to read when not monospaced (and hard to click on; for uses like {{!}}, see
{{tlw}}, which makes the click target bigger).
Usage
{{tlx|Templatename}}{{tlx|Templatename|param}}{{tlx|Templatename|1|2|3|4|5|6|7|8|9|10}}{{tlx|Templatename|1|2|3|4|5|6|7|8|9|10|more}}{{tlx|Templatename|param=value}}
There are up to 10 placeholders for parameters of the specified template.
Examples
- Note
- At the en.wikipedia and Meta sites, 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 | Result | Remarks |
{{tlx|x0}} | {{tlx模板:\sandbox|x0}} | |
{{tlx|Abc}} | {{tlx模板:\sandbox|Abc}} | |
{{tlx|ABC}} | {{tlx模板:\sandbox|ABC}} | |
{{tlx|AbC}} | {{tlx模板:\sandbox|AbC}} | |
{{tlx|x1|one}} | {{tlx模板:\sandbox|x1|one}} | |
{{tlx|x2|one|two}} | {{tlx模板:\sandbox|x2|one|two}} | |
{{tlx|x3|1|2|3|4|5|6|7|8|9|10}} | {{tlx模板:\sandbox|x3|1|2|3|4|5|6|7|8|9|10}} | |
{{tlx|x4|1|2|3|4|5|6|7|8|9|10|11}} | {{tlx模板:\sandbox|x4|1|2|3|4|5|6|7|8|9|10|11}} | up to 10 parameters... |
{{tlx|x5|1|2|3|4|5|6|7|8|9|10|11}} | {{tlx模板:\sandbox|x5|1|2|3|4|5|6|7|8|9|10|11}} | 模板:Align |
{{tlx|x1|x=u}} | {{tlx模板:\sandbox|x1|x=u}} | the straightforward equals-sign won't work... |
{{tlx|x1|x=u}} | {{tlx模板:\sandbox|x1|x=u}} | 模板:Align |
{{tlx|x1|x{{=}}u}} | {{tlx模板:\sandbox|x1|x=u}} | 模板:Align |
{{tlx|x1|<nowiki>x=u</nowiki>}} | {{tlx模板:\sandbox|x1|x=u}} | 模板:Align |
{{tlx|x2| |two}} | {{tlx模板:\sandbox|x2| |two}} | empty won't work... |
{{tlx|x2| |two}} | {{tlx模板:\sandbox|x2| |two}} | 模板:Align |
{{tlx|x2| |two}} | {{tlx模板:\sandbox|x2| |two}} | 模板:Align |
{{tlx|x2|模板:Tag|two}} | {{tlx模板:\sandbox|x2||two}} | 模板:Align |
{{tlx|x2| | two}} | {{tlx模板:\sandbox|x2| | two}} | 模板:Align |
{{tlx|x2| {{!}} two}} | {{tlx模板:\sandbox|x2 | | two}} | 模板:Align |
{{tlx|x2|2=|3=two}} | {{tlx模板:\sandbox|x2|2=|3=two}} | empty really doesn't work |
{{tlx|x2|2=one|two}} | {{tlx模板:\sandbox|x2|two}} | "two" overrides "2=one" |
{{tlx|x2|3=two|2=one}} | {{tlx模板:\sandbox|x2|3=two|2=one}} | 模板:Align |
- Unlimited parameters as one 模板:Tag string
- {{tlx模板:\sandbox|tlx|convert|<nowiki>14|m|ftin|abbr=out|sp=us</nowiki>}}
See also
{{tlxb}}, a version of {{tlx}} where the template name is shown in bold.
{{tlb}}, a version of {{tl}} where the template name is shown in bold.
{{temt}}, a version of {{tlx}} that handles templates whose names include "Template:" and pages outside the Template: namespace that are treated as templates.
{{para}}, for the presentation of template parameters and values (e.g. 模板:Para, 模板:Para).
{{tnull}}, like 模板:Tnull without linking the template.