Wikipedia:TemplateData/Tutorial: Difference between revisions
Content deleted Content added
Salix alba (talk | contribs) →Completing the TemplateData information: add details on aliases, deprectated and inherits |
→Completing the TemplateData information: quick fix - could use further improvement |
||
Line 33:
For each parameter used by the template, complete the following <code>"params"</code> information:
:* Enter the parameter being used. For example, the [[Template:Str left]] (<nowiki>{{Str left|<string>|<count>}}</nowiki>), has two parameters: string and count.
:*Note: Both parameters in this template are only recognized by their position in the template, so they should be called "1" and "2" within the TemplateData information.
:* Enter the <code>"params"</code> value. In this example, the first parameter entered was
:* Then add the information about each parameter.
:** The <code>"label"</code> is a human-readable title for the parameter that will be displayed within the template editor. Capitalize the first character of the label (since it will be the leftmost value in the resulting table), and put it in quotes. In this case, it is "Alpha-numeric text".
Line 49 ⟶ 50:
"description": "A template to give the <count> substring of characters from the start of the trimmed string ",
"params": {
"
"label": "Alpha-numeric text",
"description": "The string to be trimmed and counted",
Line 56 ⟶ 57:
"required": true
},
"
"label": "Quantity",
"description": "Gives the <count> substring of characters from the start of the trimmed string",
|