Stiles Wiki:TemplateData: Difference between revisions

From Stiles Wiki
Jump to navigation Jump to search
(Created page with "{{for|a tutorial|Wikipedia:TemplateData/Tutorial}} {{hatnote|For additional technical information, see mw:Help:TemplateData and mw:Extension:TemplateData.}} {{Short description|Information page on the use of TemplateData on Wikipedia}} {{out of date}} {{VisualEditor navbox}} {{stack|{{Shortcuts|WP:VE/TD|WP:TDATA}}}} __TOC__ == What is TemplateData? == TemplateData is the standardized description of a template, used by the default Wikipedia:VisualEditor|VisualE...")
(No difference)

Revision as of 12:05, 11 June 2022

What is TemplateData?

TemplateData is the standardized description of a template, used by the default VisualEditor, the optional 2017 wikitext editor and other tools to improve the template-editing experience for the user. Both VisualEditor and the 2017 wikitext editor include a wizard to edit templates, but for the wizard to be most useful, it needs to present specific information to the user about each template, such as a short description of the template's purpose and its parameters. This information is codified formally (by any wiki editor) using TemplateData.

Editing without TemplateData

Without TemplateData, each parameter needs to be added manually when inserting a new template.

VisualEditor - Template without TemplateData.png

No information is provided about what the value of the parameter should be.

VisualEditor - Template without TemplateData2.png

Editing with TemplateData

With TemplateData, a list of supported parameters (and their description) is provided for the template.

VisualEditor - Template with TemplateData1.png

TemplateData provides context for each parameter, and makes it much easier for users to modify templates.

VisualEditor - Template with TemplateData2.png

Adding TemplateData

Anyone can help by adding TemplateData to templates (particularly high-profile ones, such as infoboxes) so that they are easier to edit in VisualEditor. The following is a minimal example, placed on a template's documentation page:

<templatedata>{
  "description": "insert description here",
  "params": {
    "first parameter": {
      "label": "x",
      "description": "x",
      "type": "string",
      "default": "default value",
      "required": false
    }
  }
}</templatedata>

You can also add or edit TemplateData using a GUI, by pressing the following button which appears at the top of the edit page: Manage TemplateData

The TemplateData tutorial explains in detail how to add TemplateData information to a template.

Used templates

See also