Templates Wiki
Advertisement

{{T}}

Template information, documentation, and installation instructions.
Expand the below text for usage and other information.

Template Documentation:
Note: The template above might be broken without the parameters; this is normal.
View, edit, or check the history of this documentation. (How does this work?)
Editors can experiment with this template's sandbox and testcases.

Description

This is a template link with a variable number of example parameters (0–30), which can be used to show example inputs.

Parameters

First parameter
The link to the template. Defaults to the page name (current page name: T)
2nd to 31st parameter
The parameters of the demo template.
To add named parameters, example {{welcome|1st parameter|2nd parameter|text=3rd parameter}}, follow these steps:
  1. Write the parameter normally. Example: {{t|welcome|1st parameter|2nd parameter|text=3rd parameter}}.
  2. Then, count how many parameters you have added, so {{t|welcome|1st parameter|2nd parameter|text=3rd parameter}}.
    On this example, there are 4 parameters, so prefix 4= on the {{t}} template.
  3. So, the code is {{t|welcome|1st parameter|2nd parameter|4=text=3rd parameter}}, which results in {{welcome|1st parameter|2nd parameter|text=3rd parameter}}.
Note: Adding named parameters will force you to always prefix the unnamed parameter:
{{t|welcome|1st parameter|2nd parameter|4=3=3rd parameter|4th parameter}} will not work.
{{t|welcome|1st parameter|2nd parameter|4=3=3rd parameter|5=4th parameter}} will work.

The following will only work after all the parameters of the demo template is placed.
Wrong: {{t|welcome|style=code|<message>}}
Right: {{t|welcome|<message>|style=code}}

Style (style=)
The style of the {{t}} template. Has 3 styles:
  • (none) - encloses the {{t}} template with <code>
  • plain - encloses the {{t}} template with <span>
  • code - encloses the {{t}} template with <code> and adds styling to the code element.
  • pre - encloses the {{[[Template: |]]}} template with a HTML <pre> tag.
Prefix (prefix=)
A prefix before the template link, useful when instructing the user to add subst, safesubst, or something similar. The output will be similar to: prefix:[[template link]]
Note: This does not add a prefix to the link itself. Use linkprefix instead as listed below.
Link Prefix (linkprefix=)
A prefix added to the template link, for linking to other languages or wikis. [[linkprefix:template link]]
Note: This adds the prefix to the link itself. To add a prefix not included on the link, see above.
Block Mode (block=)
Makes the template styled as a block template, to aid in readablity. Combine with style=pre to get the best results.

Parameter limit

This template has a parameter limit of 30 items. If you exceed that limit, this will show up:

Template parameter limit reached! (help)

You can remove this warning and add more parameter checks to the template, however this might take some time depending on how many parameters you want.

If you want unlimited parameters alongside other features, please see w:c:dev:Global Lua Modules/T.

Examples

Basic

Syntax Output
{{t}} {{T}} (uses the page name)
{{t|welcome}} {{welcome}}
{{t|welcome|Item1|Item2|Item3|Item4|Item5|...}} {{welcome|Item1|Item2|Item3|Item4|Item5|...}}
{{t|welcome|Item1|Item2|Item3|Item4|Item5|Item6|Item7|Item8|Item9|Item10|Item11|Item12|Item13|Item14|Item15|Item16|Item17|Item18|Item19|Item20|Item21|Item22|Item23|Item24|Item25|Item26|Item27|Item28|Item29|Item30}} {{welcome|Item1|Item2|Item3|Item4|Item5|Item6|Item7|Item8|Item9|Item10|Item11|Item12|Item13|Item14|Item15|Item16|Item17|Item18|Item19|Item20|Item21|Item22|Item23|Item24|Item25|Item26|Item27|Item28|Item29|Item30}}
{{t|welcome|Item1|Item2|Item3|Item4|Item5|Item6|Item7|Item8|Item9|Item10|Item11|Item12|Item13|Item14|Item15|Item16|Item17|Item18|Item19|Item20|Item21|Item22|Item23|Item24|Item25|Item26|Item27|Item28|Item29|Item30|Item31 (error}}} Template parameter limit reached! (help)

Named parameters

Syntax Output
{{t|welcome|2=param1=Item1}} {{welcome|param1=Item1}}
{{t|welcome|2=param1=Item1|3=param2=Item2}} {{welcome|param1=Item1|param2=Item2}}
{{t|welcome|example|3=param1=Item1|4=param2=Item2}} {{welcome|example|param1=Item1|param2=Item2}}

Prefixes

Syntax Output
{{t|welcome|prefix=subst}} {{subst:welcome}}
{{t|welcome|linkprefix=w}} {{w:welcome}}
{{t|welcome|linkprefix=w|prefix=subst}} {{subst:w:welcome}}

Styling

Syntax Output
Normal
{{t|welcome|style=code}} {{welcome}}
{{t|welcome|style=plain}} {{welcome}}
{{t|welcome|2=Item1|3=Item2|4=Item3|style=pre}}
{{welcome|Item1|Item2|Item3}}
With block=
{{t|welcome|style=code|block=yes}} {{welcome
}}
{{t|welcome|style=plain|block=yes}} {{welcome
}}
{{t|welcome|2=Item1|3=Item2|4=Item3|style=pre|block=yes}}
{{welcome
|Item1
|Item2
|Item3
}}

Full usage

{{t|welcome|2=param1=Item1|3=param2=Item2|4=param3=Item3<br/>...|5=param10=Item10|block=true|style=pre|prefix=subst}}

{{subst:welcome
|param1=Item1
|param2=Item2
|param3=Item3
...
|param10=Item10
}}

See also


Installation Instructions
Export this template, then import to install it.
Use edit summary: Copied from [[w:c:templates:Template:T]] to properly attribute this template's editors.
There is no additional installation instructions for this template. If there is any, you may create it at Template:T/install.
Advertisement