Template:Template parameter usage/doc: Difference between revisions

Content deleted Content added
No edit summary
m top: {{High-use}}
 
(10 intermediate revisions by 4 users not shown)
Line 1:
{{Documentation subpage}}
{{High-use}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
{{shortcut|1=WP:TPU}}
Line 5 ⟶ 6:
 
== Usage ==
Example:
<div style="background:#ddd">
* {{tl|Infobox lighthouse}}/documentation: {{Slink|Template:Infobox_lighthouse|TemplateData}} &rarr; "''[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=Infobox+lighthouse Click here] to see a monthly parameter usage report ...''" &rarr; [https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=Infobox+lighthouse].
</div>
 
===Parameters===
{{tj|Template parameter usage
| 1: &lt;!-- template:name, default{{=}}pagename --&gt;
| lc: &lt;!-- yes/no --&gt;
| label: &lt;!-- keywords like "for", or free labeltext --&gt;
}}
:All parameters are optional, and have a default
 
By default, the template links for the template page:
:<nowiki>{{Template parameter usage}}</nowiki> &rarr; {{Template parameter usage}} [for this page]
One can enter a template name:
:<nowiki>{{Template parameter usage|Infobox film}}</nowiki> &rarr; {{Template parameter usage|Infobox film}}
 
Optional:
* {{para|lc|yes}} for lowercase "seeclick": {{Template parameter usage|lc=yes|Infobox film}}
* Entering {{para|1|Template:Infobox film}} is accepted (namespace is removed). Editor friendly, using a positional parameter.
*: When {{para|1}} is used, "this template" text changes: &rarr; {{Template parameter usage|1=Infobox film}}
* {{para|label}} sets the visible text; it (does not change the target link):
::{{para|label}} default &rarr; {{Template parameter usage|1=Infobox film}}
::{{para|label|none}} &rarr; {{Template parameter usage|1=Infobox film|label=none}}
::{{para|label|for}} &rarr; {{Template parameter usage|1=Infobox film|label=for}}
::{{para|label|FooBar}} &rarr; {{Template parameter usage|1=Infobox film|label=FooBar}}
* {{para|based|yes}} adds the text "based on this TemplateData" to the end of the template (or "based on its TemplateData" if {{para|1}} is also used).
 
The template is included in transclusions of {{Tl|TemplateData header}}.
Line 35 ⟶ 50:
:<code>Blah, {{tlp|Template parameter usage|2=lc=yes}}</code> → Blah, {{Template parameter usage|lc=yes}}
 
== TemplateData ==
{{TemplateData header}}
<templatedata>
{
"description": "Short line of text providing a link to a monthly parameter usage report for a template based on its TemplateData",
"format": "inline",
"params": {
"1lc": {},
"lclabel": {}"Lowercase",
"description": "Enter \"y\", \"yes\", \"true\", \"on\" or \"1\" here to make the text begin with a lowercase character.",
}
"type": "line",
"autovalue": "y",
"example": "y"
},
"1": {
"label": "Custom template",
"description": "Enter any template here to change the usage report link to that of that template",
"type": "wiki-template-name",
"example": "Anchor"
},
"label": {
"label": "Custom text",
"description": "Enter any text here to make the template just the usage report link with the given custom text. Alternatively, enter \"none\" to include only the usage report link, or enter \"for\" to include only the usage report link followed by \"for <template name>\".",
"type": "string"
},
"based": {
"label": "Append \"based on this[/its] TemplateData\"",
"description": "Enter \"y\", \"yes\", \"true\", \"on\" or \"1\" here to append the text \"based on this TemplateData\" (or \"based on its TemplateData\" if \"Custom template\" is also used).",
"type": "line",
"autovalue": "y",
"example": "y"
}
},
"paramOrder": [
"lc",
"1",
"label",
"based"
]
}
</templatedata>
 
==See also==
* {{tl|TemplateData header}} -- major user of this template
* [[User:Bamyers99/TemplateParametersTool]] - the tool
<includeonly>{{sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->