Template:TemplateData header/doc: Difference between revisions

Content deleted Content added
Nachaka (talk | contribs)
Tag: Reverted
m Reverted 2 edits by Nachaka (talk) to last revision by Rusty Cat
Line 6:
The {{tlx|TemplateData header}} template inserts a brief header for the template data section, and adds the page to [[:Category:Templates using TemplateData]].
 
== Usage ==
K.C Nathan
<pre style="overflow:auto;">
==TemplateData==
{{TemplateData header}}
<templatedata>{
...
}</templatedata>
 
Note: Section headers of ==Parameters== or ==Usage== may also be used.
</pre>
 
Use <code><nowiki>{{TemplateData header|Template name}}</nowiki></code> to display a name for the template other than the default, which is [[Help:Magic words#Variables|<nowiki>{{BASEPAGENAME}}</nowiki>]]. Do ''not'' add <code>Template:</code>.
:{|
|{{TemplateData header|Template name}}
|}
 
Use <code><nowiki>{{TemplateData header|nolink=1}}</nowiki></code> to omit the [[Help:Link#Wikilinks|wikilink]] from the word "TemplateData" in the header text, for instances where it is already linked outside this template.
:{|
|{{TemplateData header|nolink=1}}
|}
 
Use <code><nowiki>{{TemplateData header|noheader=1}}</nowiki></code> to omit the first sentence of the header text.
:{|
|{{TemplateData header|noheader=1}}
|}
 
==Example==
:Using a collapse box for {{elc|Template:User}}:
{{nowiki template demo|code=<nowiki>
{{collapse top|title=TemplateData}}
{{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').",
"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>
{{collapse bottom}}</nowiki>}}
 
==Parameters==