Template:TemplateData header/doc: Difference between revisions

Content deleted Content added
 
(28 intermediate revisions by 14 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}}
 
InsertsThe {{tlx|TemplateData header}} template inserts a brief header for the template data section., Addsand adds the page to [[:Category:TemplateDataTemplates documentationusing TemplateData]].
 
== Usage ==
<pre style="overflow:auto;">
<pre>
==TemplateData== or ==Parameters== or ==Usage==
{{TemplateData header}}
{{TemplateDataHeader}}
<templatedata>{
...
}</templatedata>
 
Note: Section headers of ==Parameters== or ==Usage== may also be used.
</pre>
 
Use <code><nowiki>{{TemplateDataHeaderTemplateData header|Template name}}</nowiki></code> ifto youdisplay want an alternativea name for the template toother bethan displayedthe 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==
{{TemplateData header}}
{{TemplateDataHeader}}
<templatedata>{
"description": "Inserts a brief header for the template dataTemplateData section. Adds the page to [[:Category:TemplateDataTemplates documentationusing TemplateData]]",
"params": {
"1": {
"label": "Template name",
"description": "TheUsed to display a name offor the template toother display.than the default, Defaultwhich is {{BASEPAGENAME}}.",
"type": "string",
"required": false
},
"nolink": {
"label": "No link",
"description": "Assigning any value to this parameter will omit cause the template to omit the wikilink from the word \"TemplateData\" in the header text, for instances where it is already linked outside this template.",
"type": "string",
"required": false
},
"noheader": {
"label": "No header",
"description": "Assigning any value to this parameter will cause the template to omit the first sentence of the header text.",
"type": "string",
"required": false
Line 29 ⟶ 93:
}</templatedata>
 
==SeeTracking alsocategories==
* {{clc|Category:Pages using TemplateData header with unknown parameters}}
* {{clc|Category:Templates using TemplateData}}
 
==See also==
<includeonly>
* {{tl|Template data}}
<!-- Categories go here, and interwikis go in Wikidata -->
* {{tl|Crude TemplateData}}
* {{tl|Format TemplateData}}
* {{tl|Template parameter usage}}
* {{tl|TemplateData}}
 
</includeonly>{{sandbox other||
<!-- Categories gobelow here,this andline; interwikis go inat Wikidata -->
{{DEFAULTSORT:Templatedata Header}}
[[Category:TemplateData|Header]]
[[Category:Documentation header templates]]
}}</includeonly>