Wikipedia:TemplateData/Tutorial: Difference between revisions
Content deleted Content added
Salix alba (talk | contribs) →Limitations and questions: give examples of special cases |
Salix alba (talk | contribs) →Completing the TemplateData information: there is also a string/line type in the json documentation |
||
Line 32:
For each parameter used by the template, complete the following <code>"params"</code> information:
:* Enter the parameter being used. For example, the
:*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 <string> as parameter "1".
Line 38:
:** 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".
:** Enter the <code>"description"</code>, this time a description of the parameter, not of the template as a whole. This is also likely on the main or subpage. Put the information in quotes.
:** The <code>"type"</code>, which controls how the template editor will interpret that parameter. This can be <code>"string"</code> (a set of characters, like this sentence!), <code>"number"</code> (a set of digits, no decimal points), <code>"string/wiki-user-name"</code> or <code>"string/wiki-page-name"</code>
:** <code>"default"</code> contains the default value of this parameter (in quotes). The information can be skipped, if the parameter has no default value as in this example.
:** <code>"required"</code> controls whether filling out the parameter is mandatory for that template. Enter <code>true</code> if the value is required for the template and <code>false</code> if it is not required. In this case, both count and sub_string are required values.
|