Template:Tle/doc: Difference between revisions
More actions
m expansion |
m format |
||
| Line 18: | Line 18: | ||
|desc=<u>Meta template</u> for template description. | |desc=<u>Meta template</u> for template description. | ||
Describes<!-- and explanes--> template parameters | Describes<!-- and explanes--> template parameters | ||
|namespace=Template | |namespace=Template talk | ||
|i18n-desc=The template does not generate any localizable text. | |i18n-desc=The template does not generate any localizable text. | ||
Wikimedia Commons has lots of '''template templates''', but none | Wikimedia Commons has lots of '''template templates''', but none was really able to describe the parametrizing. | ||
|usergroup=all | |usergroup=all | ||
|usage-notes= | |usage-notes= | ||
| Line 27: | Line 27: | ||
}} | }} | ||
== Explanation == | == Explanation == | ||
It is necessary to distinguish between a template and its parameter names and parameter values, and this meta-template with its meta-parameter-names and meta-parameter-values. | It is necessary to distinguish between a template and its parameter names and parameter values, and this '''meta-template''' with its meta-parameter-names and meta-parameter-values. | ||
In general, each parameter is described with a meta-pair <code>| | In general, each parameter is described with a meta-pair <code>|pn= |n= </code>, an optional meta-parameter p1...p16 for the name and an unnamed meta-parameter for the value.<br> | ||
For unnamed parameters this name can be the number; if even that is not needed some or all named meta-parameters may dismiss. | For unnamed parameters this name can be the number; if even that is not needed some or all named meta-parameters may dismiss. | ||
== | == Examples == | ||
After specifying the template name, ''its parameter values'' are specified with the unnamed meta-parameters; ''its parameter names'' can be specified with the meta-parameters p1 to | After specifying the template name, ''its parameter values'' are specified with the unnamed meta-parameters; ''its parameter names'' can be specified with the meta-parameters p1 to p{{smallsub|n}}. | ||
To describe the parameters of template <tt>Tle</tt>, the following can be used:<br> | To describe the parameters of template <tt>Tle</tt>, the following can be used:<br> | ||
| Line 44: | Line 44: | ||
or without the numbers<br> | or without the numbers<br> | ||
{{Tle|t=example|parm-value1|parm-value2 | ...|parm-value{{Smallsub|n}}}} | {{Tle|t=example|parm-value1|parm-value2 | ...|parm-value{{Smallsub|n}}}} | ||
;Example: | |||
The template {{T|Color}} has two unnamed parameters (1=''color'', 2=''text'') and three named parameters (bg, title and css). With <br> | |||
<code><nowiki>{{Tle|T=color|text color|any text|p3=bg|background color|p4=title|tooltip text|p5=css|CSS attributes}}</nowiki></code><br> | |||
this description is made: {{Tle|T=color|text color|any text|p3=bg|background color|p4=title|tooltip text|p5=css|CSS attributes}} | |||
Without any meta-parameter {{Tl|Tle|incl=0}} just shows the template name: {{Tle|T=clr}} or {{Tle|t=clr}}. | |||
{{Commons:Link templates/Template links}} | {{Commons:Link templates/Template links}} | ||
<includeonly> | <includeonly> | ||
[[Category:Internal link templates]] | [[Category:Internal link templates]]<!-- | ||
[[Category:Interwiki link templates]] | [[Category:Interwiki link templates]] --> | ||
[[Category:Typing-aid templates]] | [[Category:Typing-aid templates]] | ||
</includeonly> | </includeonly> | ||
Revision as of 09:22, 27 February 2015
Meta template for template description. Describes template parameters
Usage
{{Tle}}
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
t | name of the template. Will be displayed as plain text | Tle | optional | |
T | name of the template. Will be displayed as linkable item When parameter "T" is specified, an additional parameter "t" is ignored | empty | optional | |
1 … 16 | parameter value | empty | optional | |
p1 … p16 | parameter name | empty | optional | |
Additional information
The template is intended to be used in the following namespaces: the Template talk namespace
The template is intended to be used by the following user groups: all users == Localization ==
The template does not generate any localizable text.
Wikimedia Commons has lots of template templates, but none was really able to describe the parametrizing.
Explanation
It is necessary to distinguish between a template and its parameter names and parameter values, and this meta-template with its meta-parameter-names and meta-parameter-values.
In general, each parameter is described with a meta-pair |pn= |n= , an optional meta-parameter p1...p16 for the name and an unnamed meta-parameter for the value.
For unnamed parameters this name can be the number; if even that is not needed some or all named meta-parameters may dismiss.
Examples
After specifying the template name, its parameter values are specified with the unnamed meta-parameters; its parameter names can be specified with the meta-parameters p1 to pn.
To describe the parameters of template Tle, the following can be used:
{{ Tle | T = template-name | 1 = parm-value1 | 2 = parm-value2 | ... | n = parm-valuen | p1 = parm-name1 | p2 = parm-name2 | ... | pn = parm-namen }}
A template with only unnamed parameters e.g.
{{ Example | 1 = parm-value1 | 2 = parm-value2 | ... | n = parm-valuen }}
or without the numbers
{{ Example | parm-value1 | parm-value2 | ... | parm-valuen }}
- Example
The template {{Color}} has two unnamed parameters (1=color, 2=text) and three named parameters (bg, title and css). With
{{Tle|T=color|text color|any text|p3=bg|background color|p4=title|tooltip text|p5=css|CSS attributes}}
this description is made: {{ Color | text color | any text | bg = background color | title = tooltip text | css = CSS attributes }}
Without any meta-parameter {{Tle}} just shows the template name: {{ Clr }} or {{ Clr }}.
{{Commons:Link templates/Template links}}