Template:Tld/doc
{{tld}} is designed to display examples of how to use templates. It works similar to {{tlc}}, it shows the template's name and its parameters as code, but it uses {{tlg}} as a metatemplate, making it a little bit more versatile.
Its primary use is in instruction and documentation. The template is very good to use when you want to give examples of how to use a template.
Parameters
There are 14 optional parameters, 12 of which are unnamed.
The parameters of {{tld}} can be formatted using wiki-code.
Synatx
The syntax for {{tld}} is:
-
{{tld|template name |param2 |param3 |param4 |…|param11 }}
Optional parameters
1 (unnamed)
- Template name
The 1st parameter is the name of the template you want to present.
- Usage
{{tld|template name}}
2–12 (unnamed)
- Template parameters
The parameters 2 through 12 are used for the parameters of the displayed template.
- Notes
- The specified parameters cannot include any equals signs (=). That will break the template. If you need to do that, use the template {{=}}.
- If the maximum of 11 included parameters is exceeded, the template will only show the 11 first parameters, and exclude the surplus ones.
- Usage
{{tld|1|param1|param2|param3|param4|param5|…|param11}}
subst
- Substitution
Includes a subst: prefix before the template link/name.
allowlinebreak
- Toggle line-breaking
Entering this parameter will make the output line-wrap.
Examples
Correct use
Case | What you type | What you see | Notes |
---|---|---|---|
No parameter | {{tld}} |
{{Tld/doc}} |
Shows the name of the page where it's placed |
Only 1st parameter | templatename}} | {{templatename}} |
|
Template name + parameters |
templatename|par1|par2|par3}} | par1|par2|par3}} | |
Wiki-formatting | '''templatename'''|''par1''|'''''par2'''''|[[par3]]}} | ''par1''|'''''par2'''''|[[par3]]}} | |
Parameters with {{=}} | templatename|par1{{=}}|par2|par3{{=}}}} | par1=|par2|par3=}} |
Incorrect use
Case | What you type | What you see | Notes |
---|---|---|---|
≥ 13 entries | {{tld|templatename|2|3|4|5|6|7|8|9|10|11|12|13|14}} |
2|3|4|5|6|7|8|9|10|11|12}} | Only the 12 first entries will be displayed (i.e. the template's name and the first 11 parameters) |
Parameters with plain = | templatename|par1=|par2|par3=}} | par2}} | Parameters that include equals signs will be excluded from the output |
See also
- {{tl}}: produces a link to a template, within braces.
- {{tn}}: the same as {{tl}}, but also includes the inner pair of braces in the link, making it easier to click the link when presenting short template names.
- {{tlc}}: produces a template presentation, with the template's name and it's parameters, and wraps the output in <code>-tags.
- {{tlf}}: produces a template presentation, with the template's name and it's parameters, and wraps the output in <code>-tags.
- {{tlp}}: produces a template link, with the template's name and it's parameters, and shows the output in plain text.