Template:Tlx/doc
Appearance
This is a template link with a variable number of example parameters (0–30), which can be used to show example inputs.
Syntax
[edit source]Parameters
[edit source]- First parameter
- The link to the template. Defaults to the page name (current page name: Tlx/doc)
- 2nd to 31st parameter
- The parameters of the template.
- To add named parameters, example
{{notice|1st parameter|2nd parameter|3=3rd parameter}}, follow these steps:- Write the parameter normally. Example:
{{tlx|notice|1st parameter|2nd parameter|3=3rd parameter}}. - Then, count how many parameters you have added, so
{{t|notice|1st parameter|2nd parameter|3=3rd parameter}}.
On this example, there are 4 parameters, so prefix4=on the {{tlx}} template. - So, the code is
{{t|notice|1st parameter|2nd parameter|4==3=3rd parameter}}, which results in {{notice|1st parameter|2nd parameter|3=3rd parameter}}.
- Write the parameter normally. Example:
- Note: Adding named parameters will force you to always prefix the unnamed parameter:
{{tlx|notice|1st parameter|2nd parameter|4=3=3rd parameter|4th parameter}}will not work{{tlx|notice|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: {{tlx|notice|style=code|<message>}}
Right: {{tlx|notice|<message>|style=code}}
- Style (
style=) - The style of the {{tlx}} template. Has 1 style:
code, which encloses the {{tlx}} template with<code>
- Prefix (
prefix=) - The prefix for the template, useful when instructing the user to add
subst,safesubst, or something similar. - Note: This does not add a prefix to the link. Use
linkprefixinstead as listed below.
- Link Prefix (
linkprefix=) - The prefix for the link itself, for linking to other languages/wikis. Also shows in the 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 readability. Combine with
style=codeto get the best results.
Sample code
[edit source]| Syntax | Output |
|---|---|
{{tlx}}
|
{{Tlx/doc}} (uses the page name) |
{{tlx|notice}}
|
{{notice}} |
{{tlx|notice|Item1|Item2|Item3|Item4|Item5|...}}
|
{{notice|Item1|Item2|Item3|Item4|Item5|...}} |
{{tlx|notice|2=param1=Item1}}
|
{{notice|param1=Item1}} |
{{tlx|notice|prefix=subst}}
|
{{subst:notice}} |
{{tlx|notice|linkprefix=wp}}
|
{{wp:notice}} |
{{tlx|notice|style=code}}
|
{{notice}}
|
{{tlx|notice|2=Item1|3=Item2|4=Item3|block=true}}
|
{{notice |Item1 |Item2 |Item3 }} |
Full usage
[edit source]
{{tlx|notice|2=param1=Item1|3=param2=Item2|4=param3=Item3<br/>...|5=param10=Item10|block=true|style=code|prefix=subst}}
{{subst:notice
|param1=Item1
|param2=Item2
|param3=Item3
...
|param10=Item10
}}