https://wiki.casperdns.com/index.php?title=Template:Tlx/doc&feed=atom&action=historyTemplate:Tlx/doc - Revision history2024-03-28T18:17:15ZRevision history for this page on the wikiMediaWiki 1.35.0https://wiki.casperdns.com/index.php?title=Template:Tlx/doc&diff=2042&oldid=prevD1cd5b71-6209-4595-9bf0-771bf689ce00: 1 revision2013-06-28T13:18:15Z<p>1 revision</p>
<p><b>New page</b></p><div><includeonly><!-----------------Interwiki Doc page pattern-------------------><br />
<small>''This '{{Tlx|Tlx}}' template documentation is [[w:Wikipedia:Template doc page pattern|transcluded]] for all ''Tlx family templates (Tlx, Tlxc, Tlxw, Tlxb)'' [<span class="plainlinks">[{{fullurl:Template:Tlx/doc |action=edit}} edit]</span>].{{#ifeq:{{SITENAME}}|Meta|&nbsp;|[[M:template:{{PAGENAMEE}}|Masterpage]]<br />
&nbsp;}}</small></includeonly><noinclude> <br />
{{Documentation subpage}}<br />
{{-}}<br />
</noinclude><br />
<br />
<!-- Parent template(s) usage begins: ---><br />
<br />
Basically:<br />
: {{Tlx|Tlx|Template|first parameter|second|third|...|tenth}} ? {{Tlx|Template|first parameter|second|third|...|tenth}}<br />
Where parameters might contain "=" characters, use {{Tlx|{{=}}}} instead<br />
: {{Tlx|Tlx|Template|<nowiki>first parameter{{=}}anything|second|third{{=}}something|...|tenth</nowiki>}} ? {{Tlx|Template|first parameter{{=}}anything|second|third{{=}}something|...|tenth}}<br />
For more than 10 parameters, possibly also containing "=", use<br />
: {{Tlx|Tlx|Template|&lt;nowiki><nowiki>first|second|third=something|...|999th</nowiki>&lt;/nowiki>}} ? {{Tlx|Template|<nowiki>first|second|third=something|...|999th</nowiki>}}<br />
<br />
The [[Ellipsis|three dots]] in the examples represent a number of arguments that have been omitted and are not an actual argument.<br />
<br />
== Purpose and naming ==<br />
[[Wikt:mnemonic|Mnemonically]] ''''T'''emplate '''l'''ink e'''x'''panded'. After <tt>{{tlx|Tl}}</tt> ''''T'''emplate '''l'''ink'.<br />
<br />
* This template takes another ''template-name'' and some associated [[Help: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.<br />
* '''''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>&amp;#124;</small>''...''"). A keyword parameter can be used with equals code &amp;#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|Examples]]'' at bottom. For more details, see [[{{TALKPAGENAME}}|this talk]] page.<br />
* '''''Exceptions:''''' If the intended template lists numerous parameters, then perhaps this template should really ''not'' be used, and just hardcode the usage with {{tag|code|o}}{{tag|nowiki|o}}, for example: {{tag|code|content={{tag|nowiki|content=<nowiki>{{Anytemplate|arg1=23|size=250px|</nowiki><var>other parameters...</var><nowiki>}}</nowiki>}}}}. 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 {{tag|pre}}.<br />
<br />
----<br />
<br />
* If given no additional parameters except ''<code>&nbsp;'template&nbsp;name'&nbsp;(<nowiki>{{{1}}}</nowiki>), </code>''&nbsp;it presents the same as the similar {{tl|Tl}} [[Macro (computer science)|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. <br />
<br />
:* {{Tlx|Tl|Tl}} display compared to {{Tlx|Tlx|Tl}}: (Tl: {{Tl|Tl}} versus Tlx: {{Tlx|Tl}}) <br />
<br />
* 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.<br />
<br />
* {{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 [[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}}.<br />
<br />
* 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.<br />
<br />
== Documentation ==<br />
<br />
{&#123;[[Template:{{BASEPAGENAME}}|{{BASEPAGENAME}}]]&#125;}<br />
is a generalization of {{Tl|Tl|x}}, {{Tl|Tlp|x|y}},<br />
etcetera with arguably better readable<br />
output. This depends on the browser, but too narrow<br />
uses of "'''{'''", "'''|'''", "'''}'''" in conjunction<br />
with links can be hard to read.<br />
<br />
=== Usage ===<br />
<br />
:<tt>{&#123;{{BASEPAGENAME}}{{!}}template name&#125;}</tt><br />
:<tt>{&#123;{{BASEPAGENAME}}{{!}}template name{{!}}param&#125;}</tt><br />
:<tt>{&#123;{{BASEPAGENAME}}{{!}}template name{{!}}1{{!}}2{{!}}3{{!}}4{{!}}5{{!}}6{{!}}7{{!}}8{{!}}9{{!}}10&#125;}</tt><br />
:<tt>{&#123;{{BASEPAGENAME}}{{!}}template name{{!}}1{{!}}2{{!}}3{{!}}4{{!}}5{{!}}6{{!}}7{{!}}8{{!}}9{{!}}10&amp;#124;more&#125;}</tt><br />
:<tt>{&#123;{{BASEPAGENAME}}{{!}}template name{{!}}param&amp;#61;value&#125;}</tt><br />
''Up to 10 placeholders for parameters of the specified template''<br />
<br />
=== Examples ===<br />
{{#ifeq:{{SITENAME}}|Wikipedia|<!-- Skip message--->|<br />
{{#ifeq:{{SITENAME}}|Meta|<!-- No note needed --->|<!-- Other Sisters Note: ---><br />
;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.<br />
}}}}<br />
<br />
{| border="1" cellpadding="4" class="wikitable"<br />
! Code<br />
! Result<br />
! Remark<br />
|-<br />
|{{Tlx|Tlx|x0}}<br />
|{{Tlx|x0}}<br />
||&#160;<br />
|-<br />
|{{Tlx|Tlx|Abc}}<br />
|{{Tlx|Abc}}<br />
||&#160;<br />
|-<br />
|{{Tlx|Tlx|ABC}}<br />
|{{Tlx|ABC}}<br />
||&#160;<br />
|-<br />
|{{Tlx|Tlx|AbC}}<br />
|{{Tlx|AbC}}<br />
||&#160;<br />
|-<br />
|{{Tlx|Tlx|x1|one}}<br />
|{{Tlx|x1|one}}<br />
||&#160;<br />
|-<br />
|{{Tlx|Tlx|x2|one|two}}<br />
|{{Tlx|x2|one|two}}<br />
||&#160;<br />
|-<br />
|{{Tlx|Tlx|x3|1|2|3|4|5|6|7|8|9&#124;10}}<br />
|{{Tlx|x3|1|2|3|4|5|6|7|8|9|10}}<br />
||&#160;<br />
|-<br />
|{{Tlx|Tlx|x4|1|2|3|4|5|6|7|8|9&#124;10&#124;11}}<br />
|{{Tlx|x4|1|2|3|4|5|6|7|8|9|10|11}}<br />
|up to 10 parameters, then ...<br />
|-<br />
|{{Tlx|Tlx|x5|1|2|3|4|5|6|7|8|9&#124;10&amp;#124;11}}<br />
|{{Tlx|x5|1|2|3|4|5|6|7|8|9|10&#124;11}}<br />
|align="right"|<tt>&amp;#124;</tt> for more<br />
|-<br />
|colspan=2| {{Tlx|Tlx|convert|<nowiki>&lt;nowiki>14|m|ftin|abbr=out|sp=us&lt;/nowiki></nowiki>}}<br />
|unlimited parameters as one nowiki string<br />
|-<br />
|{{Tlx|Tlx|x1|x&#61;u}}<br />
|{{Tlx|x1|x=u}}<br />
|'''=''' won't work<br />
|-<br />
|{{Tlx|Tlx|x1|x&amp;#61;u}}<br />
|{{Tlx|x1|x&#61;u}}<br />
|align="right"|<tt>&amp;#61;</tt> is okay<br />
|-<br />
|{{Tlx|Tlx|x1|x<nowiki>{{=}}</nowiki>u}}<br />
|{{Tlx|x1|x{{=}}u}}<br />
|align="right"|<tt><nowiki>{{=}}</nowiki></tt> is okay<br />
|-<br />
|{{Tlx|Tlx|x1|&lt;nowiki&gt;x&#61;u&lt;/nowiki&gt;}}<br />
|{{Tlx|x1|<nowiki>x=u</nowiki>}}<br />
|align="right"|sticky nowiki is okay<br />
|-<br />
|{{Tlx|Tlx|x2|&#160;|two}}<br />
|{{Tlx|x2| |two}}<br />
|empty won't work<br />
|-<br />
|{{Tlx|Tlx|x2|&amp;#32;|two}}<br />
|{{Tlx|x2|&#32;|two}}<br />
|align="right"|<tt>&amp;#32;</tt> is okay<br />
|-<br />
|{{Tlx|Tlx|x2|&amp;nbsp;|two}}<br />
|{{Tlx|x2|&nbsp;|two}}<br />
|align="right"|<tt>&amp;nbsp;</tt> is okay<br />
|-<br />
|{{Tlx|Tlx|x2| &amp;#124; two}}<br />
|{{Tlx|x2| &#124; two}}<br />
|align="right"|<tt>&amp;#124;</tt> is okay<br />
|-<br />
|| {{Tlx|Tlx|x2| {&#123;!&#125;} two}}<br />
|| {{Tlx|x2| {{!}} two}}<br />
|align="right"|{{Tlx|!}} is dubious<br />
|-<br />
|| {{Tlx|Tlx|x2|<nowiki>2=</nowiki>|<nowiki>3=two</nowiki>}}<br />
|| {{Tlx|x2|2=|3=two}}<br />
|empty really doesn't work<br />
|-<br />
|| {{Tlx|Tlx|x2|<nowiki>2=one</nowiki>|two}}<br />
|| {{Tlx|x2|2=one|two}}<br />
|'''two''' clobbers '''2=one'''<br />
|-<br />
|| {{Tlx|Tlx|x2|<nowiki>3=two</nowiki>|<nowiki>2=one</nowiki>}}<br />
|| {{Tlx|x2|3=two|2=one}}<br />
|align="right"|right to left okay<br />
|}<br />
<br />
== See also ==<br />
* [[Template:Tlxb]] &ndash; same as {{tl|Tlx}}, but gives the template name in boldface type (this can be useful when stressing the difference between two similarly named templates). [[Template:Tlb]] is the same, except it uses regular text instead of a monospaced non-proportional font.<br />
* [[Template:Temt]], &ndash; same as {{tl|Tlx}}, but handles template names with the Template: prefix and templates not in the [[Wikipedia:Namespace|Template: namespace]] <nowiki>{{ns:10}}</nowiki>.<br />
* [[Template:Para]] &ndash; for giving examples of template parameters and values only, instead of entire templates with parameters.<br />
{{tl-nav}}<br />
<br />
<!--- Categories applied to both /doc style Documentation page and to the parent templates ---><br />
<br />
<!-- Add the Categories for this doc or usage page (only-- not for the calling template) BELOW THIS LINE ---><br />
<br />
<includeonly> <br />
<!-- EDIT IN (calling) TEMPLATE CATEGORIES BELOW THIS LINE --><br />
[[Category:Typing-aid templates |{{PAGENAME}}]] <br />
[[Category:Internal link templates |{{PAGENAME}}]]<br />
[[Category:Interwiki link templates |{{PAGENAME}}]]<br />
<br />
<!-- EDIT/ADD TEMPLATE Interwiki's BELOW THIS LINE --><br />
</includeonly><br />
<br />
<includeonly><br />
[[de:Vorlage:Vorlage]]<br />
</includeonly></div>D1cd5b71-6209-4595-9bf0-771bf689ce00