Template:T/doc
Jump to navigation
Jump to search
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/doc)
- 2nd to 31st parameter
- The parameters of the demo template.
- To add named parameters, example
{{t|1st parameter|2nd parameter|text=3rd parameter}}, follow these steps:- Write the parameter normally. Example:
{{t|t|1st parameter|2nd parameter|text=3rd parameter}}. - Then, count how many parameters you have added, so
{{t|t|1st parameter|2nd parameter|text=3rd parameter}}.
On this example, there are 4 parameters, so prefix4=on the{{t}}template. - So, the code is
{{t|t|1st parameter|2nd parameter|4=text=3rd parameter}}, which results in{{t|.1st parameter|2nd parameter|text=3rd parameter}}
- Write the parameter normally. Example:
- Note: Adding named parameters will force you to always prefix the unnamed parameter:
{{t|t|1st parameter|2nd parameter|4=3=3rd parameter|4th parameter}}will not work.{{t|t|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|t|style=code|<message>}}
Right: {{t|t|<message>|style=code}}
- Style (
style=) - The style of the
{{t}}template. Has 3 styles: - 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
linkprefixinstead 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=preto 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.
Examples
Basic
| Syntax | Output |
|---|---|
{{t}}
|
{{T/doc}} (uses the page name)
|
{{t|t}}
|
{{t}}
|
{{t|t|Item1|Item2|Item3|Item4|Item5|...}}
|
{{t|
|
{{t|t|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|
|
{{t|t|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|t|2=param1=Item1}}
|
{{t|
|
{{t|t|2=param1=Item1|3=param2=Item2}}
|
{{t|
|
{{t|t|example|3=param1=Item1|4=param2=Item2}}
|
{{t|
|
Prefixes
| Syntax | Output |
|---|---|
{{t|t|prefix=subst}}
|
{{subst:t}}
|
Styling
| Syntax | Output |
|---|---|
| Normal | |
{{t|t|style=code}}
|
{{t}}
|
{{t|t|style=plain}}
|
{{t}} |
{{t|t|2=Item1|3=Item2|4=Item3|style=pre}}
|
{{t|
|
With block=
| |
{{t|t|style=code|block=yes}}
|
{{t
|
{{t|t|style=plain|block=yes}}
|
{{t }} |
{{t|t|2=Item1|3=Item2|4=Item3|style=pre|block=yes}}
|
{{t
|
Full usage
{{t|t|2=param1=Item1|3=param2=Item2|4=param3=Item3<br/>...|5=param10=Item10|block=true|style=pre|prefix=subst}}
{{subst:t
|param1=Item1
|param2=Item2
|param3=Item3
...
|param10=Item10
}}