Template:TemplateData/doc

From Second Life Wiki
< Template:TemplateData
Revision as of 18:50, 15 September 2022 by Gwyneth Llewelyn (talk | contribs) (Nothing should work)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Usage

{{TemplateData|TemplateData content}}

This template is intended for inclusion in template documentation, either within /doc or the <noinclude>...</noinclude> tags of a template. It displays any content, intended to be TemplateData or transclusions of TemplateData from other locations, along with standard headers. If parameter 1 is not specified, this template detects whether the subpage /TemplateData exists for the current template, and provides a standardized header based on its existence:

  • /TemplateData exists - the template automatically transcludes the TemplateData subpage into the documentation to be used by the visual editor and other tools that read the machine code, including all of the proper headers, along with links to edit and view the page and its history.
  • /TemplateData does not exist - the template creates a section header with links to create the TemplateData subpage and preloads basic TemplateData code that is usable by Wikipedia tools.

Examples

Default /TemplateData subpage exists

{{TemplateData}}

Template-question.pngTemplate Data [create] [purge]


Missing /TemplateData subpage

{{TemplateData}}

Template-question.pngTemplate Data [create] [purge]

Alternate TemplateData content

Simple TemplateData not needing a subpage
{{TemplateData|
<templatedata>{
  "description": "simple template description",
  "format": "inline",
  "params": { }
}</templatedata>
}}
50pxTemplate Data [view] [edit] [history] [purge]
This is the "Wikipedia logo"TemplateData for this template used by TemplateWizard, "Wikipedia logo"VisualEditor and other tools. Click here to see a monthly parameter usage report for this template based on this TemplateData.

TemplateData for TemplateData

<templatedata>{

 "description": "simple template description",
 "format": "inline",
 "params": { }

}</templatedata>

Complex TemplateData transcluded from elsewhere
{{TemplateData|
{{TemplateData/other_TD_page|{{PAGENAME}}}}
|template:TemplateData/other_TD_page
}}
50pxTemplate Data [view] [edit] [history] [purge]
This is the "Wikipedia logo"TemplateData for this template used by TemplateWizard, "Wikipedia logo"VisualEditor and other tools. Click here to see a monthly parameter usage report for this template based on this TemplateData.

TemplateData for TemplateData

Template:TemplateData/other TD page