Difference between revisions of "Template:Tlx"

From Game Detectives Wiki
Jump to: navigation, search
[unchecked revision][unchecked revision]
m (--{{-}})
m (98 revisions imported)
 
(53 intermediate revisions by 33 users not shown)
Line 1: Line 1:
<includeonly><tt><nowiki>{{</nowiki>[[{{ns:Template}}:{{{1|}}}|{{{1|}}}]]<!--
+
<includeonly><!--
-->{{#if:{{{2|}}}|
+
    --><code><!--
&#124;{{{2}}}
+
        --><nowiki>{{</nowiki>{{#if:{{{subst|}}} |[[Help:Substitution|subst]]:}}<!--
}}<!--
+
                    -->[[{{{LANG|}}}{{{SISTER|}}}{{ns:Template}}:{{{1|}}}|{{{1|}}}]]<!--
-->{{#if:{{{3|}}}|
+
                          -->{{#if:{{{2|}}} |&#124;{{{2}}}}}<!--
&#124;{{{3}}}
+
                          -->{{#if:{{{3|}}} |&#124;{{{3}}}}}<!--
}}<!--
+
                          -->{{#if:{{{4|}}} |&#124;{{{4}}}}}<!--
-->{{#if:{{{4|}}}|
+
                          -->{{#if:{{{5|}}} |&#124;{{{5}}}}}<!--
&#124;{{{4}}}
+
                          -->{{#if:{{{6|}}} |&#124;{{{6}}}}}<!--
}}<!--
+
                          -->{{#if:{{{7|}}|&#124;{{{7}}}}}<!--
-->{{#if:{{{5|}}}|
+
                          -->{{#if:{{{8|}}} |&#124;{{{8}}}}}<!--
&#124;{{{5}}}
+
                          -->{{#if:{{{9|}}} |&#124;{{{9}}}}}<!--
}}<!--
+
                          -->{{#if:{{{10|}}} |&#124;{{{10}}}}}<!--
-->{{#if:{{{6|}}}|
+
                          -->{{#if:{{{11|}}} |&#124;{{{11}}}}}<!--
&#124;<i>...</i>
+
                          -->{{#if:{{{12|}}} |&#124;''...''}}<!--
}}<nowiki>}}</nowiki></tt></includeonly><noinclude> {{interwikitmp-grp|V=0}}
+
        --><nowiki>}}</nowiki><!--
{{tlx|tlx|template|first parameter|second|third|fourth|fifth|sixth|seventh|eight|ninth}} → {{tlx|template|first parameter|second|third|fourth|fifth|sixth|seventh|eight|ninth}}
+
    --></code><!--
;Purpose:Mnemonically 'Template list expanded'... after {{tlx|tl}} 'Template list' {{I2}}This template takes another ''template-name'' and some associated pipe-tricked parameters, and aggregates them into an 'example demonstration' of how the ''template-name'' template might be used. If given no additional parameters, it presents the same as the similar {{tl|Tl}} template-- a blue link nested in curly-braces-- the same as a user would apply the template without parameters.
+
--></includeonly><noinclude>
 
+
{{Documentation}}</noinclude>
 
 
Up to five parameters for the specified template are displayed as placeholders,
 
more parameters are shown as "<tt>|</tt>''...''",
 
for details see the [[w:{{TALKPAGENAME}}|talk]] page.
 
 
 
==Documentation==
 
 
 
{&#123;[[Template:{{PAGENAME}}|{{PAGENAME}}]]&#125;}
 
is a generalization of {{Tlx|Tl|x}}, {{Tlx|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.
 
 
 
=== Usage ===
 
 
 
:<tt>{&#123;{{PAGENAME}}|template name&#125;}</tt>
 
:<tt>{&#123;{{PAGENAME}}|template name|param&#125;}</tt>
 
:<tt>{&#123;{{PAGENAME}}|template name|1|2|3&#125;}</tt>
 
:<tt>{&#123;{{PAGENAME}}|template name|1|2|3&amp;#124;more&#125;}</tt>
 
:<tt>{&#123;{{PAGENAME}}|template name|param&amp;#61;value&#125;}</tt>
 
''Up to three placeholders for parameters of the specified template''
 
 
 
=== Example ===
 
;Note: On the source sister projects, en.wikipedia and Meta, '''X0, X1, X2,..., X9 are sandbox templates''' for experimentation. Here they may show as redlinks, as no auto-cleansing software facility exists.
 
 
 
{| border="1" cellpadding="4" class="wikitable"
 
! Code
 
! Result
 
! Remark
 
|-
 
|{{Tlx|Tlx|x0}}
 
|{{Tlx|x0}}
 
||&#160;
 
|-
 
|{{Tlx|Tlx|x1|one}}
 
|{{Tlx|x1|one}}
 
||&#160;
 
|-
 
|{{Tlx|Tlx|x2|one|two}}
 
|{{Tlx|x2|one|two}}
 
||&#160;
 
|-
 
|{{Tlx|Tlx|x3|1<tt>&#124;</tt>2<tt>&#124;</tt>3}}
 
|{{Tlx|x3|1|2|3}}
 
||&#160;
 
|-
 
|{{Tlx|Tlx|x4|1<tt>&#124;</tt>2<tt>&#124;</tt>3|4}}
 
|{{Tlx|x4|1|2|3|4}}
 
|up to 3 parameters
 
|-
 
|{{Tlx|Tlx|x4|1<tt>&#124;</tt>2<tt>&#124;</tt>3&amp;#124;4}}
 
|{{Tlx|x4|1|2|3&#124;4}}
 
|align="right"|<tt>&amp;#124;</tt> for more
 
|-
 
|{{Tlx|Tlx|x1|x&#61;u}}
 
|{{Tlx|x1|x=u}}
 
|'''=''' won't work
 
|-
 
|{{Tlx|Tlx|x1|x&amp;#61;u}}
 
|{{Tlx|x1|x&#61;u}}
 
|align="right"|<tt>&amp;#61;</tt> is okay
 
|-
 
|{{Tlx|Tlx|x1|&lt;nowiki&gt;x&#61;u&lt;/nowiki&gt;}}
 
|{{Tlx|x1|<nowiki>x=u</nowiki>}}
 
|align="right"|sticky nowiki is okay
 
|-
 
|{{Tlx|Tlx|x2|&#160;|two}}
 
|{{Tlx|x2| |two}}
 
|empty won't work
 
|-
 
|{{Tlx|Tlx|x2|&amp;#32;|two}}
 
|{{Tlx|x2|&#32;|two}}
 
|align="right"|<tt>&amp;#32;</tt> is okay
 
|-
 
|{{Tlx|Tlx|x2|&amp;nbsp;|two}}
 
|{{Tlx|x2|&nbsp;|two}}
 
|align="right"|<tt>&amp;nbsp;</tt> is okay
 
|-
 
|{{Tlx|Tlx|x2| &amp;#124; two}}
 
|{{Tlx|x2| &#124; two}}
 
|align="right"|<tt>&amp;#124;</tt> is okay
 
|-
 
|| {{Tlx|Tlx|x2| {&#123;!&#125;} two}}
 
|| {{Tlx|x2| {{!}} two}}
 
|align="right"|{{Tlx|!}} is dubious
 
|-
 
|| {{Tlx|Tlx|x2|<nowiki>2=</nowiki>|<nowiki>3=two</nowiki>}}
 
|| {{Tlx|x2|2=|3=two}}
 
|empty really doesn't work
 
|-
 
|| {{Tlx|Tlx|x2|<nowiki>2=one</nowiki>|two}}
 
|| {{Tlx|x2|2=one|two}}
 
|'''two''' clobbers '''2=one'''
 
|-
 
|| {{Tlx|Tlx|x2|<nowiki>3=two</nowiki>|<nowiki>2=one</nowiki>}}
 
|| {{Tlx|x2|3=two|2=one}}
 
|align="right"|right to left okay
 
|}{{-}}
 
[[Category:Typing-aid templates |{{PAGENAME}}]]
 
[[Category:Internal link templates|{{PAGENAME}}]]
 
[[Category:Templates using ParserFunctions|{{{PAGENAME}}}]]
 
----
 
<!--- Place Interwiki's beneath this line --->
 
[[ko:틀:Tlx]]
 
[[ru:Template:Tlx]]
 
</noinclude>
 

Latest revision as of 02:45, 18 May 2018

<templatestyles src="Module:Documentation/styles.css"></templatestyles>
Template documentation[view] [edit] [history] [purge]

This template creates example usage syntax for a template, and links the name to the template page. The name is derived from "Template list expanded".

Up to 7 pass parameters (numbered) for the specified template are displayed as 'placeholders', and more parameters are shown as "|...". An optional SISTER parameter can specify an interwiki prefix to link to another wiki. Examples:

Code Result Remark
{{Tlx|x0}} {{x0}}  
{{Tlx|x1|one}} {{x1|one}}  
{{Tlx|x2|one|two}} {{x2|one|two}}  
{{Tlx|x3|1|2|3}} {{x3|1|2|3}}  
{{Tlx|x4|1|2|3|4}} {{x4|1|2|3|4}} up to 7 parameters, then ...
{{Tlx|x4|1|2|3&#124;4}} {{x4|1|2|3|4}} &#124; for more
{{Tlx|x1|x=u}} {{x1}} = won't work
{{Tlx|x1|x&#61;u}} {{x1|x=u}} &#61; is okay
{{Tlx|x1|<nowiki>x=u</nowiki>}} {{x1|x=u}} sticky nowiki is okay
{{Tlx|x2| |two}} {{x2|two}} empty won't work
{{Tlx|x2|&#32;|two}} {{x2| |two}} &#32; is okay
{{Tlx|x2|&nbsp;|two}} {{x2| |two}} &nbsp; is okay
{{Tlx|x2| &#124; two}} {{x2| | two}} &#124; is okay
{{Tlx|x2| {{!}} two}} {{x2| | two}} {{!}} is dubious
{{Tlx|x2|2=|3=two}} {{x2|two}} empty really doesn't work
{{Tlx|x2|3=two|2=one}} {{x2|one|two}} right to left okay

<templatedata> { "description": "Template list expanded", "params": { "1": { "label": "Template", "description": "Linked template name", "type": "string/wiki-page-name" }, "2": { "label": "Parameter", "description": "Optional parameter", "type": "string" }, "3": { "description": "For 2 parameters", "type": "string" }, "4": { "description": "For 3 parameters", "type": "string" }, "5": { "description": "For 4 parameters", "type": "string" }, "6": { "description": "For 5 parameters", "type": "string" }, "7": { "description": "For 6 parameters", "type": "string" }, "8": { "label": "Overflow", "description": "Overflow shown as ...", "type": "string" }, "SISTER": { "label": "Interwiki", "description": "Optional InterWiki link prefix", "type": "string" } } }</templatedata>