Template:Tlx

From Electronics Chat

Jump to: navigation, search

This '{{Tlx{{#if:| |{{{2}}} }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}' template documentation is transcluded for all Tlx family templates (Tlx, Tlxm, Tlxw) [edit].{{#ifeq:Electronics Chat|Meta| |Masterpage  }}

{{#if: | }} {{#if: {{{wpd}}} | }} {{#if: {{{cms}}} | {{#ifeq: Electronics Chat|Wikimedia Commons | | }} }} {{#if: {{{wbk}}} | {{#ifeq: Electronics Chat|Wikibooks | | }} }} {{#if: | {{#ifeq:Electronics Chat|Wikiquote| | }} }} {{#if: | {{#ifeq:Electronics Chat|Wikisource| | }} }} {{#if: | {{#if: | }} }} {{#if: | {{#if: | }} }} {{#if: {{{wsp}}} | {{#ifeq:Electronics Chat|Wikispecies| | }} }} {{#if: {{{wvy}}} |

{{#ifeq:Electronics Chat|Wikiversity

| | }} }} {{#if: | }}
Similar templates at English sister projects [edit]
File:Wikimedia-logo.svg mta Meta-wiki Tlx
File:Wikipedia-logo.png wpd Wikipedia Tlx
File:Commons-logo.svg cms Commons Tlx Tlx
File:Wikibooks-logo.svg wbk WikibooksTlx Tlx
File:Wikiquote-logo.svg wqt WikiquoteTlx Tlx
File:Wikisource-logo.svg wsr WikisourceTlx Tlx
File:Wiktionary-logo-en.png wdy Wiktionary tlx
File:Wikinews-logo.svg wnw Wikinews Tlx
File:Wikispecies-logo.svg wsp WikispeciesTlx Tlx
File:Wikiversity-logo.svg wvy Wikiversity Tlx Tlx
File:Mediawiki.png mdw Mediawiki Tlx
This usage also applies to interwiki capable template variations
'Tlxm' and 'Tlxw'

{{tlx{{#if:template| |template }}{{#if:first parameter| |first parameter }}{{#if:second| |second }}{{#if:third| |third }}{{#if:fourth| |... }}}}
→ (becomes) →
{{template{{#if:first parameter| |first parameter }}{{#if:second| |second }}{{#if:third| |third }}{{#if:fourth| |fourth }}{{#if:fifth| |... }}}}

Purpose and naming: Mnemonically 'Template list expanded'... after {{tl{{#if:| |{{{2}}} }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}} 'Template list'

  • This template takes another template-name and some associated pipe-tricked (numbered) parameters (or 'pass parameters'), and aggregates them into an 'example demonstration' of how the template-name template might be used. It's primary use is in instruction and documentation such as this passage.
  • Up to five pass parameters (numbered) for the specified template are displayed as 'placeholders', and more parameters are shown as "|...", for details see the this talk page.
  • If given no additional parameters except  'template name' ({{{1}}}),  it presents the same as the similar {{Tl}} macro template -- a blue link nested in 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.
  • {{Tl{{#if:Tl|

|Tl }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}} display compared to {{Tlx{{#if:Tl| |Tl }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}: (Tl: {{Tlx}} versus Tlx: {{Tl{{#if:| |{{{2}}} }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}})

  • Comparatively, {{Tl{{#if:|

|{{{2}}} }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}} will not take or display additional parameters, and for minor technical reasons, may preferred for mere listing and referencing in long pages involving a lot of template expansions1.

  • 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. Small 'front end' Shell or convience templates {{Tlxw{{#if:|

|{{{2}}} }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}} and {{Tlxm{{#if:| |{{{2}}} }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}} are typing-aid templates available at Meta for automatic substitution in discussions about templates on Wikipedia or Meta.

[edit] Documentation

{{Tlx}} is a generalization of {{Tl{{#if:x| |x }}{{#if:| | }}{{#if:| | }}{{#if:| | }}{{#if:| |... }}}}, {{Tlp{{#if:x| |x }}{{#if:y| |y }}{{#if:| | }}{{#if:| | }}{{#if:| |... }}}}, 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. {{#ifeq:Tlx|Tlx/doc||

Usage

{{Tlx|template name}}
{{Tlx|template name|param}}
{{Tlx|template name|1|2|3}}
{{Tlx|template name|1|2|3|more}}
{{Tlx|template name|param=value}}

Up to three placeholders for parameters of the specified template }}

[edit] Examples

{{#ifeq:Electronics Chat|Wikipedia|| {{#ifeq:Electronics Chat|Meta||

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.

}}}}

Code Result Remark
{{Tlx{{#if:x0|

|x0 }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

{{x0{{#if:|

|{{{2}}} }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

 
{{Tlx{{#if:x1|

|x1 }}{{#if:one| |one }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

{{x1{{#if:one|

|one }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

 
{{Tlx{{#if:x2|

|x2 }}{{#if:one| |one }}{{#if:two| |two }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

{{x2{{#if:one|

|one }}{{#if:two| |two }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

 
{{Tlx{{#if:x3|

|x3 }}{{#if:1<tt>|2|3| |1|2|3 }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}</tt>

{{x3{{#if:1|

|1 }}{{#if:2| |2 }}{{#if:3| |3 }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

 
{{Tlx{{#if:x4|

|x4 }}{{#if:1<tt>|2|3| |1|2|3 }}{{#if:4| |4 }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}</tt>

{{x4{{#if:1|

|1 }}{{#if:2| |2 }}{{#if:3| |3 }}{{#if:4| |4 }}{{#if:| |... }}}}

up to 5 parameters, then ...
{{Tlx{{#if:x4|

|x4 }}{{#if:1<tt>|2|3&#124;4| |1|2|3&#124;4 }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}</tt>

{{x4{{#if:1|

|1 }}{{#if:2| |2 }}{{#if:3|4| |3|4 }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

&#124; for more
{{Tlx{{#if:x1|

|x1 }}{{#if:x=u| |x=u }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

{{x1{{#if:|

|{{{2}}} }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

= won't work
{{Tlx{{#if:x1|

|x1 }}{{#if:x&#61;u| |x&#61;u }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

{{x1{{#if:x=u|

|x=u }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

&#61; is okay
{{Tlx{{#if:x1|

|x1 }}{{#if:<nowiki>x=u</nowiki>| |<nowiki>x=u</nowiki> }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

{{x1{{#if:x=u|

|x=u }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

sticky nowiki is okay
{{Tlx{{#if:x2|

|x2 }}{{#if: | |  }}{{#if:two| |two }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

{{x2{{#if: |

| }}{{#if:two| |two }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

empty won't work
{{Tlx{{#if:x2|

|x2 }}{{#if:&#32;| |&#32; }}{{#if:two| |two }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

{{x2{{#if: |

| }}{{#if:two| |two }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

&#32; is okay
{{Tlx{{#if:x2|

|x2 }}{{#if:&nbsp;| |&nbsp; }}{{#if:two| |two }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

{{x2{{#if: |

|  }}{{#if:two| |two }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

&nbsp; is okay
{{Tlx{{#if:x2|

|x2 }}{{#if: &#124; two| | &#124; two }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

{{x2{{#if: | two|

| | two }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

&#124; is okay
{{Tlx{{#if:x2|

|x2 }}{{#if: {{!}} two| | {{!}} two }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

{{x2{{#if: | two|

| | two }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

{{!{{#if:|

|{{{2}}} }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}} is dubious

{{Tlx{{#if:x2|

|x2 }}{{#if:2=| |2= }}{{#if:3=two| |3=two }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

{{x2{{#if:|

| }}{{#if:two| |two }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

empty really doesn't work
{{Tlx{{#if:x2|

|x2 }}{{#if:2=one| |2=one }}{{#if:two| |two }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

{{x2{{#if:two|

|two }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

two clobbers 2=one
{{Tlx{{#if:x2|

|x2 }}{{#if:3=two| |3=two }}{{#if:2=one| |2=one }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

{{x2{{#if:one|

|one }}{{#if:two| |two }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |... }}}}

right to left okay


Personal tools