Edge Rewrite
Jump to content

Template:TemplateData header/doc

From Wikipedia, the free encyclopedia

The {{TemplateData header}} template inserts a brief header for the TemplateData section and automatically adds the page to Category:Templates using TemplateData.

Usage

[edit]
== TemplateData ==
{{TemplateData header}}
<templatedata>{

}</templatedata>

Optional parameters

[edit]

Add an optional unnamed parameter containing a template name (be sure to omit the namespace, as in {{TemplateData header|Example}}) to override the default reference to the transcluding page (as output by the {{BASEPAGENAME}} variable) in the header text. This is typically done in the case of template families which all transclude a documentation subpage from a single family member.

Markup
{{#parsoid
Renders as
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Example in articles based on its TemplateData.

TemplateData for Example


Use the |nolink=1 parameter to omit the wikilink from the word "TemplateData" in the header text, for instances when it is already linked elsewhere on the page.

Markup
{{#parsoid
Renders as
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:TemplateData header in articles based on its TemplateData.

TemplateData for TemplateData header


Use the |noheader=1 parameter to omit the first sentence of the default header text.

Markup
{{#parsoid
Renders as
See a monthly parameter usage report for Template:TemplateData header in articles based on its TemplateData.

TemplateData for TemplateData header

Example

[edit]

Some editors prefer to nest very lengthy TemplateData tables within a collapsible box template. An example of this layout for Template:User would use wikitext that resembled…

{{Collapse|title=TemplateData|content=
{{TemplateData header|User}}
<templatedata>{
	"description": "This template is used to create a link to a user's user page (unless using {{Useranon}}), talk page, and contributions, and generates a special notification (aka 'ping').",
	"format": "inline",
	"paramOrder": [
		"1",
		"lang",
		"project",
		"separator"
	],
	"params": {
		"1": {
			"label": "User name",
			"type": "string",
			"required": true,
			"description": "The user name that you want to create links to and notify.",
			"aliases":["user"]
		},
		"project": {
			"label": "Sister project",
			"type": "string",
			"description": "Used to link to a sister project instead of the English Wikipedia. Use the standard interwiki prefix."
		},
		"lang": {
			"label": "Other language project",
			"type": "string",
			"description": "Used to link to another language project. If used with the \"sister project\" parameter, links to another language of a sister project. Otherwise links to another language Wikipedia. Use the standard language code."
		},
		"separator": {
			"label": "Separator",
			"description": "Used to change the separator between the links. If unused, defaults to a dot."
		}
	}
}</templatedata>}}

…which would then be rendered as:

TemplateData

[edit]
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:TemplateData header in articles based on its TemplateData.

TemplateData for TemplateData header

Inserts a brief introduction for the TemplateData section of a documentation page and adds the root page to the 'Templates using TemplateData' category

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Template name1

Overrides the name of the template referenced as the source of the information

Default
{{BASEPAGENAME}}
Lineoptional
No headernoheader

Omits the first sentence of the header text

Booleanoptional
Unlinkednolink

Overrides linking the word 'TemplateData' in the header text to the page Wikipedia:TemplateData; useful when such a link already appears earlier on the page

Booleanoptional

Tracking categories

[edit]

See also

[edit]