Template:Format TemplateData
Appearance
| This template uses Lua: |
Usage
Add the <templatedata> as usual, and then enclose it in a call to this template as the sole unnamed/positional parameter, like {{Format TemplateData|1=.
<templatedata>...</templatedata>}}
Example output
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Format TemplateData in articles based on its TemplateData.
TemplateData for Format TemplateData
| Everything below this box is a product of this template, just as could be done with any other template documentation; read the documentation subpage source code, and expand the raw TemplateData section, to see how it all works. |
This template formats TemplateData nicely on documentation pages, hiding irrelevant information such as "Default: empty", and allows the values themselves to contain formatting. Remember that the users of VisualEditor will not see this formatting; it is important to test your new TemplateData in VisualEditor to check that it makes sense without. (For details of all of the available formatting, see the template's page.) Unless explicitly suspended with the
|header=false parameter, the {{TemplateData header}} template is automatically shown before this table.| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| TemplateData information | 1 | If the JSON parameter is not specified, this will be processed to extract the JSON. This option allows you to use the GUI TemplateData Editor, with the tradeoff of being a bit wonkier than when supplying just the actual JSON object inside them directly to the |JSON= parameter.
| String | optional |
| JSON TemplateData object | JSON | The code that would normally be wrapped in <templatedata> tags (not including the <templatedata> tags themselves. Links and basic text formatting should just work in the displayed table; see this template's page for full details. You should use HTML entities for special characters, such as <> (as < and >, respectively).Formatting options
| String | suggested |
| Show table of contents | TOC | When defined with a truthy Boolean value, a table of contents for the whole page is inserted between the template description and the parameter table.
| Boolean | optional |
| Hide TemplateData header | header | When defined with a falsey Boolean value (such as no, off, etc.), this hides the display of the {{TemplateData header}} template above the table, however this is not generally recommended.
| Boolean | optional |
| Suspend TemplateData output | lazy | When defined with any non-null value other than 0, any real TemplateData output is suspended. This may have the potential use case of multiple instances of this template on a page where only one should be active. To clarify, this means that this template will not be understood by the VisualEditor.
| Boolean | optional |
Maintenance categories
- Category:Templates with TemplateData errors (18) – the template adds this category to template documentation pages with malformed TemplateData code.
See also
- {{Crude TemplateData}}
- {{Template parameter usage}}
- {{TemplateData}}
- {{TemplateData header}}