memory alpha
Template documentation ()

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 the VisualEditor and other tools.

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}} template is automatically shown before this table.
TemplateData information1
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.
Default
See {{{JSON}}}, directly below
JSON TemplateData objectJSON
The code that would normally be wrapped in {{w|TemplateData|<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 &lt; and &gt;, respectively).

Formatting options

Wikilinks
These can be specified in the usual way. They will only be linked in the table; in the VisualEditor, only the title of the link will be displayed (as plain text).
External links
By just inserting the URL, these will be clickable in the table, and viewable in VisualEditor. If the URL is specified as [https://en.wikipedia.org/ Wikipedia], this will appear as Wikipedia in the table and https://en.wikipedia.org/ in the VisualEditor.
HTML entities
You may specify &lt;, &gt;, &amp;, &quot;, &nbsp; and any other valid XML or HTML entities.
HTML tags
These may be used, however they won't appear in the VisualEditor.
Noexport tags
Content wrapped in <noexport>…</noexport> tags will appear only in the table and never in the VisualEditor, making it useful for detailed explanations of parameters and any other content that is only useful with explicit formatting. Newline characters are respected here.
Templates
These may be transcluded, but be aware that their parsed output may make the JSON data they become part of to be invalid.
Default
If neither {{{1}}} nor {{{JSON}}} is given, the page's source code is scanned for a <templatedata> tag.
Show table of contentsTOC
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.
Suggested values
  • 1
  • on
  • true
  • y
  • yes
Default
0
Hide TemplateData headerheader
When defined with a falsey Boolean value (such as no, off, etc.), this hides the display of the {{TemplateData}} template above the table, however this is not generally recommended.
Suggested values
  • 0
  • false
  • n
  • no
  • off
Default
1
Suspend TemplateData outputlazy
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.
Suggested values
  • 1
  • on
  • true
  • y
  • yes
Default
0

Maintenance categories

See also