Template:T/main: Difference between revisions
More actions
m format |
m 18 revisions imported |
||
| (15 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
{{#ifeq:{{lc:{{{code}}}}}|tt|<code>}}<!-- code start | {{#ifeq:{{lc:{{{code}}}}}|tt|<code>}}<!-- code start | ||
-->{{#switch:{{#switch:{{{link}}}|no|n|-=1|0}}{{#switch:+|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}=1|0}}{{#switch:-|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}=1|0}}<!-- | -->{{#switch:{{#switch:{{{link}}}|no|n|-=1|0}}{{#switch:+|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}=1|0}}{{#switch:-|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}=1|0}}<!-- | ||
-->|000|010|011|100=|{{#switch:{{{case}}}|i|n={{i18n/namespace|t|link={{{case}}}o|lang={{{ | -->|000|010|011|100=|{{#switch:{{{case}}}|i|n={{i18n/namespace|t|link={{{case}}}o|lang={{{i18n|}}}}}|l=template|Template}}:}}<!-- | ||
-->{{#switch:{{{link}}}|no|n={{#switch:{{{incl|{{{i|}}}}}}|0|1|2|4|5|6={{}}<!-- | -->{{#switch:{{{link}}}|no|n={{#switch:{{{incl|{{{i|}}}}}}|3=<span style="font-family:monospace;{{{style|}}}">}}<!-- link=no | ||
-->{{#switch:{{{incl|{{{i|}}}}}}|0|1|2|3|4|5|6={{}}<!-- | |||
-->{{#switch:{{{2|}}}|+|-|={{#switch:{{{1|}}}|+|-|={{PAGENAME}}|{{PAGENAME:{{{1}}}}}}}|{{{2}}}}}<!-- when "link=no": just display | -->{{#switch:{{{2|}}}|+|-|={{#switch:{{{1|}}}|+|-|={{PAGENAME}}|{{PAGENAME:{{{1}}}}}}}|{{{2}}}}}<!-- when "link=no": just display | ||
-->{{#if:{{{parm|}}}||{{{parm}}}}}<!-- optional parm display | -->{{#if:{{{parm|}}}||{{{parm}}}}}<!-- optional parm display | ||
-->{{#switch:{{{incl|{{{i|}}}}}}|0|1|2|4|5|6=}}}}<!-- | -->{{#switch:{{{incl|{{{i|}}}}}}|0|1|2|3|4|5|6=}}}}<!-- | ||
-->{{#switch:{{{incl|{{{i|}}}}}}|3=</span>}}<!-- | |||
-->|{{#switch:+|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}=|{{#switch:{{{incl|{{{i|}}}}}}|0|4={{|1|5={}}}}<!-- | -->|{{#switch:+|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}=|{{#switch:{{{incl|{{{i|}}}}}}|0|4={{|1|5={}}}}<!-- when +: not outside | ||
-->[[:{{#switch:{{{3|}}}|+|-|=|{{trim|{{{3}}}}}:}}<!-- language code (ISO 639-1) (and/or sisterproject prefix) | |||
-->Template:{{#switch:{{{1|}}}|+|-|={{PAGENAME}}|{{PAGENAME:{{{1}}}}}}}|<!-- =link= | -->Template:{{#switch:{{{1|}}}|+|-|={{PAGENAME}}|{{PAGENAME:{{{1}}}}}}}|<!-- =link= | ||
-->{{#switch:+|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}={{#switch:{{{case}}}|i|n={{i18n/namespace|t|link=no|lang={{{ | -->{{#switch:+|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}={{#switch:{{{case}}}|i|n={{i18n/namespace|t|link=no|lang={{{i18n|}}}}}|l=template|Template}}:}}<!-- | ||
-->{{#switch:{{{incl|{{{i|}}}}}}|2|6={{|1|5={}}<!-- | -->{{#switch:{{{incl|{{{i|}}}}}}|3=<span style="font-family:monospace,monospace;{{{style|}}}">}}<!-- | ||
-->{{#switch:+|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}={{#switch:{{{incl|{{{i|}}}}}}|0|4={{|1|5={}}}}<!-- | -->{{#switch:{{{incl|{{{i|}}}}}}|2|3|6={{|1|5={}}<!-- | ||
-->{{#if:{{{code|}}}|<code>}}{{#switch:{{{incl|{{{i|}}}}}}|4|5|6|9=< | -->{{#switch:+|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}={{#switch:{{{incl|{{{i|}}}}}}|0|4={{|1|5={}}}}<!-- inside | ||
-->{{#if:{{{code|}}}|<code>}}{{#switch:{{{incl|{{{i|}}}}}}|4|5|6|9=<kbd>}}<!-- code/typewrite start | |||
-->{{#switch:{{{2|}}}|+|-|={{#switch:{{{1|}}}|+|-|={{PAGENAME}}|{{PAGENAME:{{{1}}}}}}}|{{{2}}}}}<!-- display name | -->{{#switch:{{{2|}}}|+|-|={{#switch:{{{1|}}}|+|-|={{PAGENAME}}|{{PAGENAME:{{{1}}}}}}}|{{{2}}}}}<!-- display name | ||
-->{{#switch:{{{incl|{{{i|}}}}}}|4|5|6|9=</ | -->{{#if:{{{parm|}}}|{{#switch:||{{padleft:|1|{{{parm}}}}}|{{padleft:|6|{{{parm}}}}}=||}}{{{parm}}}}}<!-- opt. parm | ||
-->{{# | -->{{#switch:{{{incl|{{{i|}}}}}}|4|5|6|9=</kbd>}}{{#if:{{{code|}}}|</code>}}<!-- typewrite/code end | ||
-->{{#switch:{{{incl|{{{i|}}}}}}| | -->{{#switch:{{{incl|{{{i|}}}}}}|2|3|6=}}|1|5=}}}<!-- | ||
-->]]{{#switch:{{{incl|{{{i|}}}}}}|0|4=}}|1|5=}}}}}<!-- | -->{{#switch:{{{incl|{{{i|}}}}}}|3=</span>}}<!-- | ||
-->{{#switch:+|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}={{#switch:{{{incl|{{{i|}}}}}}|0|4=}}|1|5=}}}}}<!-- inside | |||
-->]]{{#switch:+|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}=|{{#switch:{{{incl|{{{i|}}}}}}|0|4=}}|1|5=}}}}}}}<!-- not outside | |||
-->{{#ifeq:{{lc:{{{code}}}}}|tt|</code>}}<!-- code end | -->{{#ifeq:{{lc:{{{code}}}}}|tt|</code>}}<!-- code end | ||
-->{{#if:{{{full|{{#ifeq:{{{5}}}|full|1}}}}}|<span class="plainlinks"><!-- | |||
--> <kbd>(</kbd><small>[{{fullurl:Template:{{{1|{{PAGENAME}}}}}}} {{int:view}}]<!-- | |||
--> • [{{fullurl:Template:{{{1|{{PAGENAME}}}}}|action=edit}} {{int:edit}}]<!-- | |||
--> • [[:Template talk:{{{1|{{PAGENAME}}}}}|{{int:talk}}]]<!-- | |||
--> • [{{fullurl:Special:Whatlinkshere/Template:{{{1|{{PAGENAME}}}}}|limit=500}} Links]<!-- {{int:links}} needs fix | |||
--> • [{{fullurl:Template:{{{1|{{PAGENAME}}}}}|action=history}} History]</small><kbd>)</kbd><!-- | |||
--></span>}}<!-- | |||
--><noinclude> | --><noinclude> | ||
{{documentation|Template:T/doc}} | {{documentation|Template:T/doc}} | ||
</noinclude> | </noinclude> | ||
Latest revision as of 06:05, 9 August 2026
The {{T}} template creates a formatted link to a Template.
The T template creates a formatted link to a template and surrounds it with braces ({{...}}) included in the link label.
Usage
{{T |1= }}
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | template name (any namespace is ignored) | T | optional | |
2 | display name (displayed as-it-is) | parameter 1 | optional | |
3lang | interwiki language code (ISO 639), if the template is in another Wikipedia can also be specified with lang= | empty | optional | |
4 | +/- to precede the template name with the namespace Template:
(when both signs are specified, "+" has precedence). | empty | optional | |
incli | i or incl is a one-digit formatting option:
| 2 | optional | |
code | any value, for a surrounding <code> tag (like {{Tl2}}).With code=tt also the surrounding brackets are in teletype style. | empty | optional | |
link | returns plain text instead of a link when set to link=no | empty | optional | |
case | for formatting of the namespace prefix:
| empty | optional | |
i18n | another language than {{int:lang}} for namespace translation (when case=i or case=n) | en | optional | |
parm | to display templates parameters (like {{Tlx}}) Usage e.g.
| empty | optional | |
full | expanded display: Template:{{Example}} (like {{Lts}}) request this expansion with either full=5 or 5=full. | empty | optional | |
Additional information
The template is intended to be used in the following namespaces: all namespaces
The template is intended to be used by the following user groups: all users
Localization
This template is not intended to be localized.
The template does not generate any localizable text;
with + or - always the namespace in English: "Template" is displayed;
only in combination with case=i or case=n the namespace can be translated using the {{LangSwitch}} construct (according to i18n).
{{Commons:Link templates/T-doc-expansion}}
{{Commons:Link templates/Template links}}