What is template data?

සංස්කරණය

Template data 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 template data.

Editing without template data

සංස්කරණය

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

 

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

 

Editing with template data

සංස්කරණය

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

 

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

 

Adding template data

සංස්කරණය

Anyone can help by adding template data 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",
      "suggested": true,
      "autovalue": "derived automatic value",
      "default": "default value",
      "required": false
    }
  }
}</templatedata>

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

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

"https://si.wikipedia.org/w/index.php?title=විකිපීඩියා:TemplateData&oldid=534305" වෙතින් සම්ප්‍රවේශනය කෙරිණි