Template:Tlf/doc: Difference between revisions
(Created page with "{{Documentation subpage}} <!-- PLEASE ADD CATEGORIES AT THE END OF THIS PAGE. --> {{tlf|'''tlf'''}} is designed to display examples of how to use templates. It works similar t...") |
|||
(15 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
<!-- PLEASE ADD CATEGORIES AT THE END OF THIS PAGE. --> | <!-- PLEASE ADD CATEGORIES AT THE END OF THIS PAGE. --> | ||
{{tlf|'''tlf'''}} is designed to display examples of how to use templates. It works similar to {{tlf|tl}} and {{tlf|tlc}} but doesn't link to the template it displays (like {{tl|tl}}), or wrap <code>-tags around the it (like {{tlc|tlc}}). It shows the template name and its parameters in the page's default font. | {{tlf|'''tlf'''}} is designed to display examples of how to use templates. It works similar to {{tlf|tl}} and {{tlf|tlc}} but doesn't link to the template it displays (like {{tl|tl}}), or wrap <code>-tags around the it (like {{tlc|tlc}}). It shows the template's name and its parameters in the page's default font. | ||
The template is very good to use when you want to present template code in inline text. | Its primary use is in instruction and documentation. The template is very good to use when you want to present template code in inline text. | ||
__NOTOC__ | |||
==Parameters== | ==Parameters== | ||
There are 12 optional parameters, all unnamed. If no parameters are specified, {{tlf|tlf}} will become a presentation of itself with the parameters replaced by an ellipsis (see the examples below). | There are 12 optional parameters, all unnamed. If no parameters are specified, {{tlf|tlf}} will become a presentation of itself with the parameters replaced by an ellipsis (see the examples below). | ||
Line 24: | Line 24: | ||
====2–12 (unnamed)==== | ====2–12 (unnamed)==== | ||
;<big> | ;<big>Template parameters</big> | ||
The parameters 2 through 12 are used for the parameters of the displayed template. | The parameters 2 through 12 are used for the parameters of the displayed template. | ||
;Notes | ;Notes | ||
* The specified parameters cannot include any equals | * The specified parameters cannot include any equals signs ({{=}}). That will break the template. If you need to do that, use the template <nowiki>{{=}}</nowiki>. | ||
* If the maximum of 11 included parameters is exceeded, the template will only show the 11 first parameters, and exclude the surplus ones. | * If the maximum of 11 included parameters is exceeded, the template will only show the 11 first parameters, and exclude the surplus ones. | ||
Line 46: | Line 46: | ||
| Template name + <br>parameters || {{tlc|tlf|templatename|par1|par2|par3}} || {{tlf|templatename|par1|par2|par3}} || | | Template name + <br>parameters || {{tlc|tlf|templatename|par1|par2|par3}} || {{tlf|templatename|par1|par2|par3}} || | ||
|- | |- | ||
| Wiki-formatting || {{tlc|tlf|'''templatename'''|''par1''|'''''par2'''''| | | Wiki-formatting || {{tlc|tlf|<nowiki>'''templatename'''|''par1''|'''''par2'''''|[[par3]]</nowiki>}} || {{tlf|'''templatename'''|''par1''|'''''par2'''''|[[par3]]}} || | ||
|- | |||
| Parameters with <nowiki>{{=}}</nowiki> || {{tlc|tlf|templatename|<nowiki>par1{{=}}</nowiki>|par2|<nowiki>par3{{=}}</nowiki>}} || {{tlf|templatename|par1{{=}}|par2|par3{{=}}}} || | |||
|} | |} | ||
Line 54: | Line 56: | ||
! Case !! What you type !! What you see !! Notes | ! Case !! What you type !! What you see !! Notes | ||
|- | |- | ||
| ≥ 13 | | ≥ 13 entries || <code><nowiki>{{tlf|templatename|2|3|4|5|6|7|8|9|10|11|12|13|14}}</nowiki></code> || {{tlf|templatename|2|3|4|5|6|7|8|9|10|11|12|13|14}} || Only the 12 first entries will be displayed (i.e. the template's name and the first 11 parameters) | ||
|- | |- | ||
| Parameters with {{=}} || {{tlc|tlf|templatename|<nowiki>par1=</nowiki>|par2|<nowiki>par3=</nowiki>}} || {{tlf|templatename|par1=|par2|par3=}} || Parameters that | | Parameters with {{=}} || {{tlc|tlf|templatename|<nowiki>par1=</nowiki>|par2|<nowiki>par3=</nowiki>}} || {{tlf|templatename|par1=|par2|par3=}} || Parameters that include equals signs will be excluded from the output | ||
|} | |} | ||
==See also== | ==See also== | ||
* {{tl|tl}}: produces a link to a template, within | * {{tl|tl}}: produces a link to a template, within braces. | ||
* {{tl| | * {{tl|tn}}: the same as {{tlf|tl}}, but also includes the inner pair of braces in the link, making it easier to click the link when presenting short template names. | ||
* {{tl|tlc}}: produces a template presentation, with the template's name and it's parameters, and wraps the output in <code>-tags. | |||
* {{tl|tlp}}: produces a template link, with the template's name and it's parameters, and shows the output in plain text. | |||
<includeonly> | <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | ||
<!-- Categories | | <!-- Categories below this line, please --> | ||
[[Category:Template help templates]] | |||
[[Category:Template help templates | [[Category:Typing-aid templates]]}} | ||
[[Category: | |||
</includeonly> | </includeonly> |
Latest revision as of 10:01, 31 January 2015
{{tlf}} is designed to display examples of how to use templates. It works similar to {{tl}} and {{tlc}} but doesn't link to the template it displays (like {{tl}}), or wrap <code>-tags around the it (like {{tlc}}
). It shows the template's name and its parameters in the page's default font.
Its primary use is in instruction and documentation. The template is very good to use when you want to present template code in inline text.
Parameters
There are 12 optional parameters, all unnamed. If no parameters are specified, {{tlf}} will become a presentation of itself with the parameters replaced by an ellipsis (see the examples below).
The parameters of {{tlf}} can be formatted using wiki-code.
Synatx
The syntax for {{tlf}} is:
{{tlf|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
{{tlf|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
{{tlf|1|param1|param2|param3|param4|param5|…|param11}}
Examples
Correct use
Case | What you type | What you see | Notes |
---|---|---|---|
No parameter | {{tlf}} |
{{tlf|...}} | Presents itself |
Only 1st parameter | {{tlf|templatename}} |
{{templatename}} | |
Template name + parameters |
{{tlf|templatename|par1|par2|par3}} |
{{templatename|par1|par2|par3}} | |
Wiki-formatting | {{tlf|'''templatename'''|''par1''|'''''par2'''''|[[par3]]}} |
{{templatename|par1|par2|par3}} | |
Parameters with {{=}} | {{tlf|templatename|par1{{=}}|par2|par3{{=}}}} |
{{templatename|par1=|par2|par3=}} |
Incorrect use
Case | What you type | What you see | Notes |
---|---|---|---|
≥ 13 entries | {{tlf|templatename|2|3|4|5|6|7|8|9|10|11|12|13|14}} |
{{templatename|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 = | {{tlf|templatename|par1=|par2|par3=}} |
{{templatename|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.
- {{tlp}}: produces a template link, with the template's name and it's parameters, and shows the output in plain text.