Template:Tld/doc: Difference between revisions
More actions
Add {{Uses TemplateStyles}} |
+/doc |
||
| (3 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
== TemplateData == | == TemplateData == | ||
{{TemplateData header}} | {{TemplateData header}} | ||
| Line 65: | Line 50: | ||
"label": "Parameter 8", | "label": "Parameter 8", | ||
"description": "Eighth parameter value", | "description": "Eighth parameter value", | ||
"type": "string" | |||
}, | |||
"class": { | |||
"label": "Extra Class Names", | |||
"description": "Extra class names to add to the “class” attribute.", | |||
"type": "string" | "type": "string" | ||
}, | }, | ||
| Line 71: | Line 61: | ||
"description": "Whether to add “<span style=\"white-space: nowrap\">”", | "description": "Whether to add “<span style=\"white-space: nowrap\">”", | ||
"autovalue": "1", | "autovalue": "1", | ||
"type": "boolean" | |||
}, | |||
"doc": { | |||
"label": "doc", | |||
"description": "Whether to display a linked “+/doc”", | |||
"type": "boolean" | "type": "boolean" | ||
} | } | ||
}, | }, | ||
"paramOrder": [ | "paramOrder": [ | ||
"class", | |||
"doc", | |||
"nowrap", | "nowrap", | ||
"1", | "1", | ||
| Line 92: | Line 89: | ||
<includeonly>{{Sandbox other|| | <includeonly>{{Sandbox other|| | ||
<!-- Categories below this line; interwikis at Wikidata --> | <!-- Categories below this line; interwikis at Wikidata --> | ||
[[Category:Internal link templates{{#translation:}}]] | [[Category:Internal template-link templates{{#translation:}}]] | ||
}}</includeonly> | }}</includeonly> | ||
Latest revision as of 04:20, 22 February 2024
TemplateData
- TemplateData
TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.
Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either useTemplateData=1 or useTemplateData=only on the /doc subpage and transcluding it with {{Documentation}} into the template. <nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.
Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw <templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.
Wikipedia's help about TemplateData • Commons-specific information
Template link code with link
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Extra Class Names | class | Extra class names to add to the “class” attribute. | String | optional |
| doc | doc | Whether to display a linked “+/doc” | Boolean | optional |
| Nowrap? | nowrap | Whether to add “<span style="white-space: nowrap">”
| Boolean | optional |
| Template | 1 | Linked template name | Template | required |
| Parameter 1 | 2 | First parameter value | String | optional |
| Parameter 2 | 3 | Second parameter value | String | optional |
| Parameter 3 | 4 | Third parameter value | String | optional |
| Parameter 4 | 5 | Fourth parameter value | String | optional |
| Parameter 5 | 6 | Fifth parameter value | String | optional |
| Parameter 6 | 7 | Sixth parameter value | String | optional |
| Parameter 7 | 8 | Seventh parameter value | String | optional |
| Parameter 8 | 9 | Eighth parameter value | String | optional |