More actions
Created page with "<includeonly>{{small |1=Note: This documentation for {{tlx|tlx}} is also transcluded by its derivatives {{tlx|tlxb}}, {{tlx|tlxc}} (<span class="plainlinks">[{{fullurl:Template:Tlx/doc |action=edit}} edit]</span>{{#ifeq:{{SITENAME}}|Meta |). |{{dot}}[[M:template:{{PAGENAMEE}}|master page]]).}}<!--(end small:)-->}}</includeonly><noinclude>{{Documentation subpage}}{{clear}}</noinclude>{{#ifeq:{{BASEPAGENAME}}|Tlx |{{High-risk|2325910..." |
No edit summary |
||
| (10 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<includeonly>{{small |1=Note: This documentation for {{tlx|tlx}} is also | {{wikipedia|page name}} | ||
<includeonly>{{small |1=Note: This documentation for {{tlx|tlx}} is also transcluded by its derivatives {{tlx|tlxb}}, {{tlx|tlxc}} (<span class="plainlinks">[{{fullurl:Template:Tlx/doc |action=edit}} edit]</span>{{#ifeq:{{SITENAME}}|Meta |). |{{dot}}master page).}}<!--(end small:)-->}}</includeonly><noinclude>{{Documentation subpage}}{{clear}}</noinclude>{{#ifeq:{{BASEPAGENAME}}|Tlx |{{High-risk|2325910+}} }} | |||
This template is used to show example template usage without expanding the template itself. | This template is used to show example template usage without expanding the template itself. | ||
==Basic use== | ==Basic use== | ||
''(Note: In the following examples, | ''(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 parameter''|...|''tenth parameter''}} produces: {{tlx{{\sandbox}}|Template|''first parameter''|''second parameter''|''third parameter''|...|''tenth parameter''}} | : {{tlx{{\sandbox}}|tlx|Template|''first parameter''|''second parameter''|''third parameter''|...|''tenth parameter''}} produces: {{tlx{{\sandbox}}|Template|''first parameter''|''second parameter''|''third parameter''|...|''tenth parameter''}} | ||
| Line 15: | Line 16: | ||
==Purpose and naming== | ==Purpose and naming== | ||
Mnemonically, ''template link expanded'' (after '' | Mnemonically, ''template link expanded'' (after ''template link''). | ||
This template allows an example of calling a template, accompanied by one or more parameters<!-- ("pass parameters", i.e. [[Help:Pipe trick|pipe-tricked]] [[m:Parameter#Parameters|parameters]])-->, to be displayed without also causing the template to be called. | This template allows an example of calling a template, accompanied by one or more parameters<!-- ("pass parameters", i.e. [[Help:Pipe trick|pipe-tricked]] [[m:Parameter#Parameters|parameters]])-->, to be displayed without also causing the template to be called. | ||
Up to 20 of the template's parameters (numbered or nowiki-keywords) may be displayed as placeholders, while more than over 20 parameters can be displayed using a coded vertical bar (pipe) symbol, as in <code>&#124;</code>. A keyword parameter can be used with equals code &#61; or <nowiki>{{=}}</nowiki> or in nowiki-text: "{{tag|nowiki|content=size=10}}" or all parameters as a string in "{{tag|nowiki|o}}" tags; see '' | Up to 20 of the template's parameters (numbered or nowiki-keywords) may be displayed as placeholders, while more than over 20 parameters can be displayed using a coded vertical bar (pipe) symbol, as in <code>&#124;</code>. A keyword parameter can be used with equals code &#61; or <nowiki>{{=}}</nowiki> or in nowiki-text: "{{tag|nowiki|content=size=10}}" or all parameters as a string in "{{tag|nowiki|o}}" tags; see ''Examples'' at bottom. For more details, see this talk page. If you use 21 or more parameters, all after the 20th will be replaced with a single {{para||...}} at the end of the parameter list. | ||
; Exceptions | ; Exceptions | ||
| Line 27: | Line 28: | ||
===Parameters=== | ===Parameters=== | ||
*If the only parameter supplied is | *If the only parameter supplied is , i.e. a template's name, {{tlx|tlx}}'s output is the same as {{tlx|tl}} – i.e. a link within braces – but in a monospaced font: | ||
** | ** produces: {{tl|tl}} | ||
** | ** produces: {{tlx{{\sandbox}}|tl}} | ||
: {{tlx|tl}} will also not take nor display additional parameters. | : {{tlx|tl}} will also not take nor display additional parameters. | ||
; Named parameters | ; Named parameters | ||
{{para|subst}} | {{para|subst}} | ||
: Setting this parameter to any non-blank value will prefix the string <code>subst:</code> linked to | : Setting this parameter to any non-blank value will prefix the string <code>subst:</code> 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 template: {{tlx{{\sandbox}}|tlxs|Welcome}} produces:. | ||
{{para|SISTER}} | {{para|SISTER}} | ||
: For an interwiki link to | : For an interwiki link to other sister projects, such as: {{para|SISTER|M:}} (Meta), {{para|SISTER|Q:}} (WikiQuote), {{para|SISTER|S:}} (WikiSource), etc, facilitating interwiki template documentation and/or discussion. | ||
{{para|LANG}} | {{para|LANG}} | ||
: For a link to | : For a link to Wikipedias in other languages, such as: {{para|LANG|de:}} (German), {{para|LANG|sv:}} (Swedish), etc, facilitating cross-language template documentation and/or discussion. | ||
==Documentation== | ==Documentation== | ||
{{tl|Tlx}} is a generalization of {{tl|tl|x}}, {{tl|tlp|x|y}} etc., with output that is arguably more legible. This depends on the browser, but narrow gaps between characters such as " | {{tl|Tlx}} is a generalization of {{tl|tl|x}}, {{tl|tlp|x|y}} 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 <code><nowiki>{{!}}</nowiki></code>, see , which makes the click target bigger). | ||
===Usage=== | ===Usage=== | ||
| Line 56: | Line 57: | ||
}} | }} | ||
; Unlimited parameters as one {{tag|nowiki}} string | ; Unlimited parameters as one {{tag|nowiki}} string | ||
: {{tlx{{\sandbox}}|tlx|convert|<nowiki><nowiki>14|m|ftin|abbr=out|sp=us</nowiki></nowiki>}} | : {{tlx{{\sandbox}}|tlx|convert|<nowiki><nowiki>14|m|ftin|abbr=out|sp=us</nowiki></nowiki>}} | ||
| Line 236: | Line 204: | ||
{{collapse bottom}} | {{collapse bottom}} | ||
<includeonly>{{Sandbox other||{{#ifeq:{{BASEPAGENAME}}|Tlx | | <includeonly>{{Sandbox other||{{#ifeq:{{BASEPAGENAME}}|Tlx | | ||
[[Category:Internal template-link templates]] | [[Category:Internal template-link templates]] | ||
Latest revision as of 18:27, 9 April 2025
| This page uses Creative Commons Licensed content from Wikipedia (view authors). |
| This is a documentation subpage for Template:Template link expanded It may contain usage information, categories and other content that is not part of the original template page. |
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|Template|first parameter|second parameter|third parameter|...|tenth parameter}}produces:{{Template|first parameter|second parameter|third parameter|...|tenth parameter}}
When you want to indicate setting a value to one or more parameters, you would normally use the equals-sign ("="). This doesn't work here; instead use {{=}}, like so:
{{tlx|Template|first{{=}}first value|second|third{{=}}third value}}produces:{{Template|first=first value|second|third=third value}}
For more than ten parameters – with or without equals-signs – instead wrap the entire list of parameters and their values in <nowiki>...</nowiki> tags. When you do, you don't need to replace equals-signs. For instance:
{{tlx|Template|<nowiki>''first''|''second''|''third=value''|...|''999th''</nowiki>}}produces:{{Template|first|second|third=value|...|999th}}
Purpose and naming
Mnemonically, template link expanded (after template link).
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 20 of the template's parameters (numbered or nowiki-keywords) may be displayed as placeholders, while more than over 20 parameters can be displayed using a coded vertical bar (pipe) symbol, 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. If you use 21 or more parameters, all after the 20th will be replaced with a single |... at the end of the parameter list.
- 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
- If the only parameter supplied is , 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}}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,{{tlx|Welcome|subst=Y}}produces:{{subst:Welcome}}. This is similar to the action of the template:{{tlxs|Welcome}}produces:.
|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
{{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 , 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.
- Unlimited parameters as one
<nowiki>...</nowiki>string {{tlx|convert|<nowiki>14|m|ftin|abbr=out|sp=us</nowiki>}}
TemplateData
TemplateData documentation used by VisualEditor and other tools
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
See a monthly parameter usage report for Template:Template link expanded in articles based on its TemplateData.
TemplateData for Template link expanded Show example template usage without expanding the template itself. {{tnull}} is similar without linking the template.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||