Wikipedia:TemplateData/Tutorial: Difference between revisions

Content deleted Content added
Line 28:
 
Then, for each parameter used by the template, complete the following "params" information:
:* Enter the parameter being used. For example, per the [[Template:Str left]] information, (<nowiki>{{Str left|<string>|<count>}}</nowiki>), the template has two parameters: string and count.
:* Enter the "params" value. In this example, the first parameter entered was "count"
:* Then add the information about each parameter.
:** The "label" 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 "Quantity".
:** Enter the "description", 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 "type", which controls how the template editor will interpret that parameter. This can be "string" (a set of characters, like this sentence!), "number" (a set of digits), "string/wiki-user-name" or "string/wiki-page-name".indicates if it's a number or a string.
:** "Required" controls whether filling out the parameter is mandatory for that template. Enter "true" if the value is required for the template and "false" if it is not required. In this case, both count and sub_string are required values.