Template:TemplateData header/doc: Difference between revisions

Content deleted Content added
make easier to copy & paste
 
(13 intermediate revisions by 9 users not shown)
Line 1:
{{Documentation subpage}}
{{High-use}}
<!-- CategoriesAdd gocategories where indicated at the bottom of this page and interwikis go inat Wikidata. -->
{{Lua|Module:Check for unknown parameters}}
 
The {{tlx|TemplateData header}} template inserts a brief header for the template data section, and adds the page to [[:Category:Templates using TemplateData]].
Line 15 ⟶ 17:
</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_wordsMagic words#Variables|<nowiki>{{BASEPAGENAME}}</nowiki>]]. Do ''not'' add namespace <code>Template:</code>.
:{|
|{{TemplateData header|Template name}}
Line 29 ⟶ 31:
|{{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==
{{TemplateData header}}
<templatedata>{
"description": "Inserts a brief header for the template dataTemplateData section. Adds the page to [[:Category:Templates using TemplateData]]",
"params": {
"1": {
Line 56 ⟶ 93:
}</templatedata>
 
==SeeTracking alsocategories==
* {{clc|Category:Pages using TemplateData header with unknown parameters}} – Tracking
* {{clc|Category:Templates using TemplateData}}
 
* {{clc|Category:Pages using TemplateData header with unknown parameters}} – Tracking
==See also==
* {{tl|Template parameter usage}}
* {{tl|Template data}}
* {{tl|Crude TemplateData}}
* {{tl|Format TemplateData}}
<includeonly>{{sandbox other||
* {{tl|Template parameter usage}}
<!-- Categories go here, and interwikis go in Wikidata -->
* {{tl|TemplateData}}
[[Category:TemplateData|header]]
 
<includeonly>{{sandbox other||
<!-- Categories gobelow here,this andline; interwikis go inat Wikidata -->
{{DEFAULTSORT:Templatedata Header}}
[[Category:TemplateData|headerHeader]]
[[Category:Documentation header templates]]
}}</includeonly>