模板:Template parameter usage/doc

来自决策链云智库
< 模板:Template parameter usage
Zeroclanzhang讨论 | 贡献2024年1月16日 (二) 01:53的版本 (创建页面,内容为“{{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}} The [https://bambots.brucemyers.com/TemplateParam.php Template Parameters tool] is available for viewing template parameter usage in articles. It works with TemplateData to show the frequency of parameter name usage in a template's mainspace tra…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

The Template Parameters tool is available for viewing template parameter usage in articles. It works with TemplateData to show the frequency of parameter name usage in a template's mainspace transclusions, along with whether or not each parameter is listed in that template's TemplateData code as a supported parameter. For a required parameter, it can display a list of pages where the template is missing that parameter. The tool also shows commonly used values for each parameter. Each report is updated monthly and does not reflect changes made to articles or to the TemplateData code after the report's generation.

Usage

Example:

Parameters

{{Template parameter usage
| 1 = <!-- template:name, default=pagename -->
| lc = <!-- yes/no -->
| label = <!-- keywords like "for", or free labeltext -->
}}
All parameters are optional, and have a default

By default, the template links for the template page:

{{Template parameter usage}} → See a monthly parameter usage report for this template in articles. [for this page]

One can enter a template name:

{{Template parameter usage|Infobox film}} → See a monthly parameter usage report for Template:Infobox film in articles.

Optional:

When |1= is used, "this template" text changes: → See a monthly parameter usage report for Template:Infobox film in articles.
  • |label= sets the visible text; it does not change the target link:
|label= default → See a monthly parameter usage report for Template:Infobox film in articles.
|label=noneParameter usage report
|label=forParameter usage report for Template:Infobox film.
|label=FooBarFooBar
  • |based=yes adds the text "based on this TemplateData" to the end of the template (or "based on its TemplateData" if |1= is also used).

The template is included in transclusions of {{TemplateData header}}.

Error reports

{{Template parameter usage}}

By default, it links a report for the template-page being viewed. To link a report for a different template-page, pass it as the first parameter:

{{Template parameter usage|<Example>}} makes a link to the error report for Template:Example:
See a monthly parameter usage report for Template:Example in articles.

The first character can be made lowercase to follow on at the end of a sentence:

Blah, {{Template parameter usage|lc=yes}} → Blah, see a monthly parameter usage report for this template in articles.

TemplateData

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

TemplateData for Template parameter usage

Short line of text providing a link to a monthly parameter usage report for a template based on its TemplateData

模板参数

此模板首选参数不换行的行内格式。

参数描述类型状态
Lowercaselc

Enter "y", "yes", "true", "on" or "1" here to make the text begin with a lowercase character.

示例值
y
自动值
y
单行文本可选
Custom template1

Enter any template here to change the usage report link to that of that template

示例值
Anchor
模板可选
Custom textlabel

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>".

字符串可选
Append "based on this[/its] TemplateData"based

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).

示例值
y
自动值
y
单行文本可选

See also