Template:T: Difference between revisions

mNo edit summary
m Removed background color to allow dynamic color shift in dark mode.
 
(21 intermediate revisions by the same user not shown)
Line 10: Line 10:
-->}}</code></includeonly><noinclude>
-->}}</code></includeonly><noinclude>
== Description ==
== Description ==
{{for|Wikipedia: Template: Tlx|additional details and information}}
This template is used to provide stylized formatting to template displays without actually using the template itself. It will provide a link to that template's page in the [[:Category:Templates|Template namespace]]. Most commonly, this template is used for demonstrative or linking purposes in the [[:Help:Contents|Help Guide]] or on a Template's Description page.
This template is used to provide stylized formatting to template displays without actually using the template itself. It will provide a link to that template's page in the [[:Category:Templates|Template namespace]]. Most commonly, this template is used for demonstrative or linking purposes in the [[:Help:Contents|Help Guide]] or on a Template's Description page.
{{for|Wikipedia: Template: Tlx|additional details and information}}


== Usage ==
== Usage ==
{| style="width: 100%; text-align: left; margin: auto;" class="wikitable"
{| style="width: 100%; text-align: left; margin: left;" class="wikitable"
|-
|-
! colspan="2" style="text-align: center;" | <span style="font-size: 115%;">Default Usage</span><br><span style="font-weight: normal;">When used with no additional parameters, the template will return a list split in 3 columns.</span>
! colspan="2" style="text-align: center;" | <span style="font-size: 115%;">Template Link</span><br><span style="font-weight: normal;">To simply create a link to a template, pass the template's name.</span>
|-
|-
! width=25%|You Type
! width=25%|You Type
!You Get
!You Get
|-
|-
| style="text-align: left; background-color: white;" |<pre>
| style="text-align: center;" |<pre>
{{columns|
{{t|Example}}
* Item 1
* Item 2
* Item 3
* Item 4
* Item 5
* Item 6
}}
</pre>
</pre>
| style="background-color: white;" |{{columns|
| style="text-align: center;" |{{t|Example}}
* Item 1
* Item 2
* Item 3
* Item 4
* Item 5
* Item 6
}}
|-
|-
! colspan="2" style="text-align: center;" | <span style="font-size: 115%;">Count Parameter</span><br><span style="font-weight: normal;">You can specify the number of columns in the output through use of the <code>count=</code> parameter.</span>
! colspan="2" style="text-align: center;" | <span style="font-size: 115%;">Unnamed Parameter</span><br><span style="font-weight: normal;">To demonstrate unnamed parameters, simply pass the input.</span>
|-
|-
! width=25%|You Type
! width=25%|You Type
!You Get
!You Get
|-
|-
| style="text-align: left; background-color: white;" |<pre>
| style="text-align: left;" |<pre>
{{columns|count=2|
{{t
* Item 1
|Example
* Item 2
|PARAMETER1
* Item 3
|PARAMETER2
* Item 4
|PARAMETER3
* Item 5
* Item 6
}}
}}
</pre>
</pre>
| style="background-color: white;" |{{columns|count=2|
| style="text-align: center;" |{{t|Example|PARAMETER1|PARAMETER2|PARAMETER3}}
* Item 1
|-
* Item 2
! colspan="2" style="text-align: center;" | <span style="font-size: 115%;">Named Parameter</span><span style="font-weight: normal;"><br>Named parameters will not appear in the output if passed only using <code>=</code>.<br>You can pass named parameters in one of three ways:</span>
* Item 3
|-
* Item 4
! colspan="2" | You Type
* Item 5
 
* Item 6
|-
}}
| colspan="2" style="text-align: center;"|<span style="display: block; text-align: left;">1. Use a unicode equals sign (<code>&#<span>61</span>;</code>) instead of <code>=</code>:</span>
<div style="width: 65%; margin: 0 auto;"><pre>{{t|Example|name&#38;#61;INPUT|date&#38;#61;INPUT|location&#38;#61;INPUT}}</pre></div>
|-
| colspan="2" style="text-align: center;"|<span style="display: block; text-align: left;">2. Surround the parameters in a <code>&lt;nowiki&gt;</code> tag:</span>
<div style="width: 65%; margin: 0 auto;"><pre>{{t|Example&lt;nowiki&gt;|name=INPUT|date=INPUT|location=INPUT&lt;/nowiki&gt;}}</pre></div>
|-
| colspan="2" style="text-align: center;"|<span style="display: block; text-align: left;">3. Use correctly numbered parameters, i.e., <code>2=</code>, <code>3=</code>, etc.:</span>
<div style="width: 65%; margin: 0 auto;"><pre>{{t|Example|2=name=INPUT|3=date=INPUT|4=location=INPUT}}</pre></div>
|-
! colspan="2" | You Get
|-
| colspan="2" style="text-align: center;"|<div>
{{t|Example|name&#61;INPUT|date&#61;INPUT|location&#61;INPUT}}
</div>
|}
|}
{{t|t|template name|first parameter|second parameter}}.
To pass named parameters, you can
* use <code>name &#<span>61</span>; value</code> — {{t|t|Rosharan numeric date|year &#<span>61</span>; 1172|month &#<span>61</span>; 5|week &#<span>61</span>; 10|day &#<span>61</span>; 6}};
* surround it in <code><nowiki><nowiki /></nowiki></code> tags — <code><nowiki>{{t|Rosharan numeric date|<nowiki>year=1172|month=5|week=1|day=6</nowiki></nowiki>}}</code>; or
* use correctly numbered parameters.
{{t|Columns|count&#61;3|* Item 1* Item 2}}


== Pages using Template ==
== Pages using Template ==
Line 77: Line 66:
{{Special:WhatLinksHere/{{FULLPAGENAME}}|limit=100}}
{{Special:WhatLinksHere/{{FULLPAGENAME}}|limit=100}}


 
[[Category:Administrative Templates]]
[[Category: Templates]]