68,642
edits
m (Protected "Template:Tlx/doc": Robot: Protecting all pages from category templates ([edit=sysop] (indefinite) [move=sysop] (indefinite))) |
No edit summary |
||
Line 1: | Line 1: | ||
{{tlx|tlx}} — an acronym for '''template link expanded''' — is a sort of more useful sister to {{tlx|tl}}. It allows you do demonstrate templates more fully, by letting you show not just the template name, but ''also the parameters''. It's almost always preferable to use {{tlx|tlx}} than {{tlx|tl}} — even when you're ''not'' demonstrating parameters — because it automatically converts to a highly readable monospaced font. | |||
== Details == | |||
* This template takes another ''template-name'' and some associated [[tardis:Pipe trick|pipe-tricked]] [[m:Parameter#Parameters|(numbered) parameters]] (or 'pass parameters'), and displays them as an 'example demonstration' of how the ''template-name'' template could be coded, literally. Its primary use is in instruction and documentation. | |||
* This template takes another ''template-name'' and some associated [[ | |||
* '''''Specifics:''''' Up to 10 pass parameters (numbered or nowiki-keywords) for the specified template are displayed as 'placeholders', and over 10 parameters can be displayed using a coded vertical-bar (as in "<small>&#124;</small>''...''"). A keyword parameter can be used with equals code &#61; or <nowiki>{{=}}</nowiki> or in nowiki-text: "<nowiki>size=10</nowiki>" or all parameters as a string in <nowiki>"<nowiki>"</nowiki> tags; see ''[[#Examples|Examples]]'' at bottom. For more details, see [[{{TALKPAGENAME}}|this talk]] page. | * '''''Specifics:''''' Up to 10 pass parameters (numbered or nowiki-keywords) for the specified template are displayed as 'placeholders', and over 10 parameters can be displayed using a coded vertical-bar (as in "<small>&#124;</small>''...''"). A keyword parameter can be used with equals code &#61; or <nowiki>{{=}}</nowiki> or in nowiki-text: "<nowiki>size=10</nowiki>" or all parameters as a string in <nowiki>"<nowiki>"</nowiki> tags; see ''[[#Examples|Examples]]'' at bottom. For more details, see [[{{TALKPAGENAME}}|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 {{nowrap|<code><nowiki><code><nowiki></nowiki></code>}}, for example: {{nowrap|<code><nowiki><code><nowiki>{{Anytemplate|arg1=23|size=250px|</nowiki><var>other parameters...</var><nowiki>}}</nowiki></code></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 {{nowrap|<code><nowiki><pre>...</pre></nowiki></code>}}. | * '''''Exceptions:''''' If the intended template lists numerous parameters, then perhaps this template should really ''not'' be used, and just hardcode the usage with {{nowrap|<code><nowiki><code><nowiki></nowiki></code>}}, for example: {{nowrap|<code><nowiki><code><nowiki>{{Anytemplate|arg1=23|size=250px|</nowiki><var>other parameters...</var><nowiki>}}</nowiki></code></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 {{nowrap|<code><nowiki><pre>...</pre></nowiki></code>}}. | ||
* If given no additional parameters except ''<code> 'template name' (<nowiki>{{{1}}}</nowiki>), </code>'' it presents the same as the similar {{tl|Tl}} [[macro]] template -- a blue link nested in [[brackets|curly-braces]]-- the same as a user would apply the template without parameters, but with a noticably clearer font and spacing on most modern browsers. | * If given no additional parameters except ''<code> 'template name' (<nowiki>{{{1}}}</nowiki>), </code>'' it presents the same as the similar {{tl|Tl}} [[macro]] template -- a blue link nested in [[brackets|curly-braces]]-- the same as a user would apply the template without parameters, but with a noticably clearer font and spacing on most modern browsers. | ||
:* {{Tlx|Tl|Tl}} display compared to {{Tlx|Tlx|Tl}}: (Tl: {{Tl|Tl}} versus Tlx: {{Tlx|Tl}}) | :* {{Tlx|Tl|Tl}} display compared to {{Tlx|Tlx|Tl}}: (Tl: {{Tl|Tl}} versus Tlx: {{Tlx|Tl}}) | ||
* Comparatively, {{Tlx|Tl}} will not take or display additional parameters, and for minor technical reasons, may be preferred for mere listing and referencing in long pages involving a lot of template expansions. | * Comparatively, {{Tlx|Tl}} will not take or display additional parameters, and for minor technical reasons, may be preferred for mere listing and referencing in long pages involving a lot of template expansions. | ||
* {{tlx|Tlx}} has a named parameter ''subst''. Setting this parameter to any string of length 1 or greater will place the string "subst:" before the template name, linked to {{w|Help:Substitution}}. This is useful to indicate when a template should be substituted. For example {{tlx|Tlx|Welcome|<nowiki>subst=Y</nowiki>}} will display {{Tlx|Welcome|subst=Y}}. | |||
* {{tlx|Tlx}} has a named parameter ''subst''. Setting this parameter to any string of length 1 or greater will place the string "subst:" before the template name, linked to | |||
* Additionally, Tlx will take a 'named' parameter 'SISTER' to link interwiki to other sister projects such as one of these examples: '|SISTER=W:', 'Tlx|SISTER=M:', 'Tlx|SISTER=Q:', 'Tlx|SISTER=S:', allowing documentation or discourse about a template across interwiki boundaries. | * Additionally, Tlx will take a 'named' parameter 'SISTER' to link interwiki to other sister projects such as one of these examples: '|SISTER=W:', 'Tlx|SISTER=M:', 'Tlx|SISTER=Q:', 'Tlx|SISTER=S:', allowing documentation or discourse about a template across interwiki boundaries. | ||
* {{[[Template:{{BASEPAGENAME}}|{{BASEPAGENAME}}]]}} is a generalisation of {{Tl|Tl|x}}, {{Tl|Tlp|x|y}}, etcetera with arguably better readable output. This depends on the browser, but too narrow uses of "'''{'''", "'''|'''", "'''}'''" in conjunction with links can be hard to read. | |||
{{[[Template:{{BASEPAGENAME}}|{{BASEPAGENAME}}]]}} | |||
is a | |||
etcetera with arguably better readable | |||
output. This depends on the browser, but too narrow | |||
uses of "'''{'''", "'''|'''", "'''}'''" in conjunction | |||
with links can be hard to read. | |||
=== Usage === | === Usage === |
edits