Template:Wp/nod/Tlx
ᨿᩢ᩠ᨦᨷ᩵ᨸᩖᩯ
Note: This documentation for {{tlx}}
is also transcluded by its derivatives {{tlxb}}
, {{tlxc}}
, {{tlxw}}
(editTemplate:Wp/nod/dotmaster page).
This template is used to show example template usage without expanding the template itself.
Basic use
edit(Note: In the following examples, ellipses (groups of three dots) indicate where parameters have been omitted.)
- {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|tlx|Template|first parameter|second parameter|third|...|tenth}} produces: {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|Template|first parameter|second parameter|third|...|tenth}}
Where parameters might contain one or more equals-signs ("="), replace each equals-sign with {{=}}:
- {{Wp/nod/tlxTemplate:Wp/nod\sandbox|tlx|Template|first{{=}}something|second|third{{=}}something|...|tenth}} produces: {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|Template|first=something|second|third=something|...|tenth}}
For more than ten parameters, possibly also containing equals-signs, use <nowiki>...</nowiki>
thus:
- {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|tlx|Template|<nowiki>''first''|''second''|''third=something''|...|''999th''</nowiki>}} produces: {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|Template|first|second|third=something|...|999th}}
Purpose and naming
editMnemonically, "[t]emplate [l]ink e[x]panded" (after {{tl}}, "[t]emplate [l]ink").
This template allows an example of calling a template, accompanied by one or more parameters, to be displayed without also causing the template to be called.
Up to ten of the template's parameters (numbered or nowiki-keywords) may be displayed as placeholders, while more than over 10 parameters can be displayed using a coded vertical-bar (as in "|..."). A keyword parameter can be used with equals code = or {{=}} or in nowiki-text: "<nowiki>size=10</nowiki>
" or all parameters as a string in "<nowiki>
" tags; see Examples at bottom. For more details, see this talk page.
- Exceptions
If the intended template lists numerous parameters, then perhaps this template should really not be used, and just hardcode the usage with <code>
<nowiki>
. For example:
<code>
.<nowiki>{{Anytemplate|arg1=23|size=250px|other parameters...}}</nowiki>
</code>
If a vertical display, with parameters on their own lines, is desired, this can also be laid out manually in this manner, or more rapidly done with <pre>...</pre>
.
Parameters
edit- If the only parameter supplied is Template:Wp/nod/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:
{{tl|tl}}
produces: {{tl}}{{tlx|tl}}
produces: {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|tl}}
- {{tl}} will also not take nor display additional parameters.
- Named parameters
|subst=
- 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, {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|tlx|Welcome|3=subst=Y}} produces: {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|Welcome|subst=Y}}. This is similar to the action of the {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|tlxs}} template: {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|tlxs|Welcome}} produces: Template:Tlxs.
|SISTER=
- For an interwiki link to other sister projects, such as:
|SISTER=M:
(Meta),|SISTER=Q:
(WikiQuote),|SISTER=S:
(WikiSource), etc, facilitating interwiki template documentation and/or discussion.
|LANG=
- For a link to Wikipedias in other languages, such as:
|LANG=de:
(German),|LANG=sv:
(Swedish), etc, facilitating cross-language template documentation and/or discussion.
Documentation
edit{{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 " { ", " | ", " } " 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
edit{{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
edit- 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}} | {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x0}} | |
{{tlx|Abc}} | {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|Abc}} | |
{{tlx|ABC}} | {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|ABC}} | |
{{tlx|AbC}} | {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|AbC}} | |
{{tlx|x1|one}} | {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x1|one}} | |
{{tlx|x2|one|two}} | {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x2|one|two}} | |
{{tlx|x3|1|2|3|4|5|6|7|8|9|10}} | {{Wp/nod/tlxTemplate:Wp/nod/\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}} | {{Wp/nod/tlxTemplate:Wp/nod/\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}} | {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x5|1|2|3|4|5|6|7|8|9|10|11}} | Template:Align |
{{tlx|x1|x=u}} | {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x1|x=u}} | the straightforward equals-sign won't work... |
{{tlx|x1|x=u}} | {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x1|x=u}} | Template:Align |
{{tlx|x1|x{{=}}u}} | {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x1|x=u}} | Template:Align |
{{tlx|x1|<nowiki>x=u</nowiki>}} | {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x1|x=u}} | Template:Align |
{{tlx|x2| |two}} | {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x2| |two}} | empty won't work... |
{{tlx|x2| |two}} | {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x2| |two}} | Template:Align |
{{tlx|x2| |two}} | {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x2| |two}} | Template:Align |
{{tlx|x2| | {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x2||two}} | Template:Align |
{{tlx|x2| | two}} | {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x2| | two}} | Template:Align |
{{tlx|x2| {{!}} two}} | {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x2 | | two}} | Template:Align |
{{tlx|x2|2=|3=two}} | {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x2|2=|3=two}} | empty really doesn't work |
{{tlx|x2|2=one|two}} | {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x2|two}} | "two" overrides "2=one" |
{{tlx|x2|3=two|2=one}} | {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|x2|3=two|2=one}} | Template:Align |
- Unlimited parameters as one
<nowiki>...</nowiki>
string - {{Wp/nod/tlxTemplate:Wp/nod/\sandbox|tlx|convert|<nowiki>14|m|ftin|abbr=out|sp=us</nowiki>}}
See also
edit- {{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.
|paraname=val
,|another=
).
Template-linking templates
editGeneral-purpose formatting
editOther formatting templates
editCode example | Effect | Notes |
---|---|---|
{{tl2|Hatnote|lang=fr}}
|
{{hatnote}} |
Supports linking to sister projects (e.g., fr:Hatnote) |
{{demo|<nowiki>{{Hatnote|lang=fr|Some text}}</nowiki>}}
|
Template:Wp/nod/demo | Shows code and example |
{{tln|Hatnote}}
|
Template:Wp/nod/tln | Produces a normal link to the template |
{{elc|Template:Hatnote}} {{elc|Template:Hatnote|Hatnote}}
|
Template:Wp/nod/elc Template:Elc |
Formats wikilink, with optional piped link text and blended suffix |
{{ml|Example|hello}}
|
Template:Wp/nod/ml | Counterpart to {{tl}} for linking to Lua modules |
{{mlx|Example|hello}}
|
Template:Wp/nod/mlx | Counterpart to {{tlx}} for linking to Lua modules |
{{ml-lua|Module:Example|hello}}
|
Template:Wp/nod/ml-lua | Link to Lua modules and built-in libraries, showing Lua code. |
{{para|title|<var>book title</var>}}
|
|title=book title |
Formats template parameters for display, with or without values |
{{sclx|LASTING}}
|
Template:Sclx | Takes a shortcut suffix in project namespace and displays it with brackets and the WP: alias in a <code>...</code> tag.
|
{{tag|ref}} {{xtag|templatedata}}
|
<ref>...</ref> Template:Xtag |
Formats [X]HTML tags; can add content, choose opening, closing, or self-closing |
{{dtl|Ping project}}
|
Template:Wp/nod/dtl | Wikidata counterpart to {{tl}} |
{{pf|if}} {{pf|if|{{{1}}}|true|false}}
|
Template:Wp/nod/pf Template:Wp/nod/pf |
Parser function equivalent to {{tl}} |
{{magic word|uc:}}
|
Template:Wp/nod/magic word | Magic word links |
With utility links
editCode example | Effect |
---|---|
{{lt|Hatnote}}
|
Template:Wp/nod/lt |
{{lts|Hatnote}}
|
Template:Wp/nod/lts |
{{t links|Hatnote}}
|
Template:Wp/nod/t links |
{{tfd links|Hatnote}}
|
Template:Wp/nod/tfd links |
{{tetl|Hatnote}}
|
Template:Wp/nod/tetl |
{{tsetl|Hatnote}}
|
Template:Wp/nod/tsetl |
{{ti|Hatnote}}
|
Template:Wp/nod/ti |
{{tic|Hatnote}}
|
Template:Wp/nod/tic |
{{tim|Hatnote}}
|
Template:Wp/nod/tim |
{{tiw|Hatnote}}
|
Template:Hatnote Template:Wp/nod/smaller |
{{tlt|Hatnote}}
|
Template:Wp/nod/tlt |
{{ttl|Hatnote}}
|
Template:Wp/nod/ttl |
{{twlh|Hatnote}}
|
Template:Wp/nod/twlh |
Template data | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Show example template usage without expanding the template itself.
|
The above documentation is transcluded from Template:Wp/nod/Tlx/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |
Cite error: <ref>
tags exist for a group named "note", but no corresponding <references group="note"/>
tag was found