跳转到内容

Template:Broader/doc:修订间差异

勤求古训,博采众方
删除的内容 添加的内容
拉取适配 zhwiki 模板文档(去简繁)
 
删除互助客栈提示句
 
(未显示同一用户的4个中间版本)
第2行: 第2行:
{{Lua|Module:Broader}}
{{Lua|Module:Broader}}


本模板用于明确标示"概述性条目"(summary style)。效果如下:
This template is used to make summary style explicit. It looks like this:


{{Broader|Article}}
{{Broader|方剂学}}


该模板应当于有有关于当前叙述主题的更广泛条目时使用,但不是主条目 (用{{tl|Main}}),一个更窄的主题 (用 {{tl|Further}}),或同一层面上的关注(应用{{tl|See also}})。
该模板应当有关于当前叙述主题的更广泛条目时使用,但不是主条目应用 {{tl|Main}})、更窄的主题应用 {{tl|Further}}),或同一层面上的关注(应用 {{tl|See also}})。


== Usage ==
== 用法 ==


; Basic usage: {{tlc|Broader|''article''}}
; 基本用法:{{tlc|Broader|''方剂学''}}
; With a topic: {{tlc|Broader|''article''|topic{{=}}''topic''}}
; 带主题:{{tlc|Broader|''方剂学''|topic{{=}}''主题''}}
; With more than one target page: {{tlc|Broader|''article1''|''article2''|''article3''|topic{{=}}''topic''}}
; 多个目标页面:{{tlc|Broader|''方剂学1''|''方剂学2''|''方剂学3''|topic{{=}}''主题''}}
; All parameters: {{tlc|Broader|''article''|topic{{=}}''topic''|selfref{{=}}''yes''|category{{=}}''no''}}
; 全部参数:{{tlc|Broader|''方剂学''|topic{{=}}''主题''|selfref{{=}}''yes''|category{{=}}''no''}}


== Parameters ==
== 参数 ==


本模板接受以下参数:
This template accepts the following parameters:
* <code>1</code> – 要链接的页面(必填)。分类和文件会自动使用[[Help:冒号技法|冒号技法]]转义,指向章节的链接会自动格式化为 ''页面 § 章节'',而非 MediaWiki 默认的 ''页面#章节''。
* <code>1</code> - the page to link to (required). Categories and files are automatically escaped with the [[Help:Colon trick|colon trick]], and links to sections are automatically formatted as ''page § section'', rather than the MediaWiki default of ''page#section''.
* <code>2</code>(及更大数字)– 其他要链接的页面。与第一个参数一样自动格式化。
* <code>2</code> (and greater numbers) - any additional pages to link to. These links are also automatically formatted as with the first parameter.
* <code>topic</code> – 主题名称。如未指定,默认使用"本主题"。
* <code>topic</code> - the name of the topic. If this is not specified, the text "this topic" is used.
* <code>selfref</code> - if set to "yes", "y", "true" or "1", adds the CSS class "selfref". This is used to denote self-references to Wikipedia. See [[Template:Selfref]] for more information.
* <code>selfref</code> 若设为"yes""y""true""1",添加 CSS "selfref"。用于表示对维基百科的自我提及。参见 [[Template:Selfref]]
* <code>category</code> - if set to "no", "n", "false", or "0", suppresses the error tracking category ([[:Category:Hatnote templates with errors]]). This only has an effect if the first positional parameter (the page to link to) is omitted.
* <code>category</code> 若设为"no""n""false""0",抑制错误跟踪分类([[:Category:有错误的顶注模板]])。仅在省略第一个位置参数(要链接的页面)时有效。


== Examples ==
== 示例 ==


* {{tlc|Broader|Article}} &rarr; {{Broader|Article}}
* {{tlc|Broader|方剂学}} &rarr; {{Broader|方剂学}}
* {{tlc|Broader|Article|topic{{=}}some topic}} &rarr; {{Broader|Article|topic=some topic}}
* {{tlc|Broader|方剂学|topic{{=}}中药学}} &rarr; {{Broader|方剂学|topic=中药学}}


== Errors ==
== 错误 ==


若未提供页面名称,模板将输出以下信息:
If no page name is supplied, the template will output the following message:
* {{Broader|category=no}}
* {{Broader|category=no}}


若看到此错误信息,可能是以下四种原因之一:
If you see this error message, it is for one of four reasons:
# No parameters were specified (the template code was <code><nowiki>{{Broader}}</nowiki></code>). Please use <code><nowiki>{{Broader|</nowiki>''page''<nowiki>}}</nowiki></code> instead.
# 未指定任何参数(模板代码为 <code><nowiki>{{Broader}}</nowiki></code>)。请改用 <code><nowiki>{{Broader|</nowiki>''页面''<nowiki>}}</nowiki></code>
# Some parameters were specified, but the page name wasn't included. For example, the template text <code><nowiki>{{Broader|selfref=yes}}</nowiki></code> will produce this error. Please use (for example) <code><nowiki>{{Broader|</nowiki>''page''<nowiki>|selfref=yes}}</nowiki></code> instead.
# 指定了部分参数,但未包含页面名称。例如模板代码 <code><nowiki>{{Broader|selfref=yes}}</nowiki></code> 会产生此错误。请改用(例如)<code><nowiki>{{Broader|</nowiki>''页面''<nowiki>|selfref=yes}}</nowiki></code>
# The page name was specified, but it contains an equals sign ("="). The equals sign has a special meaning in template code, and because of this it cannot be used in template parameters that do not specify a parameter name. For example, the template code <code><nowiki>{{Broader|2+2=4}}</nowiki></code> will produce this error. To work around this, you can specify the parameter name explictly by using <code>1=</code> before the page name (like this: <code><nowiki>{{Broader|1=2+2=4}}</nowiki></code>) or you can disable the equals being interpreted as delimiting a parameter name by [[Template:=|surrounding the equals with double braces]] (like this: <code><nowiki>{{Broader|2+2{{=}}4}}</nowiki></code>).
# 指定了页面名称,但包含等号("=")。等号在模板代码中有特殊含义,因此不能用于未指定参数名的模板参数中。例如模板代码 <code><nowiki>{{Broader|2+2=4}}</nowiki></code> 会产生此错误。可通过在页面名称前加 <code>1=</code> 显式指定参数名(如 <code><nowiki>{{Broader|1=2+2=4}}</nowiki></code>),或用 [[Template:=|双花括号包裹等号]](如 <code><nowiki>{{Broader|2+2{{=}}4}}</nowiki></code>)来避免等号被解释为参数名分隔符。


包含此错误信息的页面会归入 [[:Category:有错误的顶注模板]]。
If you see this error message and are unsure of what to do, please post a message on [[WP:HD|the help desk]], and someone should be able to help you.


== 参见 ==
Pages that contain this error message are tracked in [[:Category:Hatnote templates with errors]].
* {{tl|Further}}

== See also ==
*{{tl|Further}}


{{Hatnote templates}}
{{Hatnote templates}}
{{Collapse top|TemplateData documentation used by VisualEditor and other tools}}
{{Collapse top|用于可视化编辑器等工具的模板数据文档}}
{{TemplateData header|noheader=1}}
{{TemplateData header|noheader=1}}
<templatedata>
<templatedata>
{
{
"description": "此模板用于向读者显示与特定主题相关的更广泛内容的条目位置。通常放在章节或方剂学的顶部。",
"description": "This template is used to show readers where to find broader coverage related to a particular topic. It is usually placed at the top of a section or article.",
"params": {
"params": {
"1": {
"1": {
"label": "Article",
"label": "方剂学",
"description": "The name of the article that you want to link to",
"description": "要链接的方剂学名称",
"type": "string",
"type": "string",
"required": true
"required": true
},
},
"2": {
"2": {
"label": "Article 2",
"label": "方剂学 2",
"description": "The name of an additional article that you want to link to",
"description": "要链接的第二个方剂学",
"type": "string",
"type": "string",
"required": false
"required": false
},
},
"3": {
"3": {
"label": "Article 3",
"label": "方剂学 3",
"description": "The name of an additional article that you want to link to",
"description": "要链接的第三个方剂学",
"type": "string",
"type": "string",
"required": false
"required": false
},
},
"4": {
"4": {
"label": "Article 4",
"label": "方剂学 4",
"description": "The name of an additional article that you want to link to",
"description": "要链接的第四个方剂学",
"type": "string",
"required": false
},
"5": {
"label": "方剂学 5",
"description": "要链接的第五个方剂学",
"type": "string",
"type": "string",
"required": false
"required": false
},
},
"topic": {
"topic": {
"label": "Topic",
"label": "主题",
"description": "主题名称",
"description": "A brief description of the topic related to which a broader coverage will be provided. If left blank, the template will read 'For broader coverage related to this topic...'",
"type": "string",
"type": "string",
"required": false
"required": false
},
},
"selfref": {
"selfref": {
"type": "string/line",
"label": "自我引用",
"label": "Self reference",
"description": "设为 yes 以添加 selfref CSS 类",
"type": "boolean",
"description": "Set to \"yes\" if the hatnote text is a self-reference to Wikipedia that would not make sense on mirrors or forks of the Wikipedia site. (E.g. \"For the Wikipedia Sandbox, see [[WP:SAND]]\".)"
"required": false
},
},
"category": {
"category": {
"label": "Category",
"label": "分类",
"description": "设为 no 以抑制错误跟踪分类",
"description": "Set to \"no\", \"n\", \"false\", or \"0\" to suppresses the error tracking category (Category:Hatnote templates with errors). This only has an effect if the hatnote text is omitted."
"type": "boolean",
"required": false
}
}
}
}
第96行: 第103行:
</templatedata>
</templatedata>
{{Collapse bottom}}
{{Collapse bottom}}

<includeonly>{{Sandbox other||
<!-- Categories go here and interwikis go in Wikidata. -->

[[Category:顶注模板]]
}}</includeonly>

2026年8月1日 (六) 11:57的最新版本

本模板用于明确标示"概述性条目"(summary style)。效果如下:

该模板应当在有关于当前叙述主题的更广泛条目时使用,但不是主条目(应用 {{Main}})、更窄的主题(应用 {{Further}}),或同一层面上的关注(应用 {{See also}})。

用法

基本用法:{{Broader|方剂学}}
带主题:{{Broader|方剂学|topic=主题}}
多个目标页面:{{Broader|方剂学1|方剂学2|方剂学3|topic=主题}}
全部参数:{{Broader|方剂学|topic=主题|selfref=yes|category=no}}

参数

本模板接受以下参数:

  • 1 – 要链接的页面(必填)。分类和文件会自动使用冒号技法转义,指向章节的链接会自动格式化为 页面 § 章节,而非 MediaWiki 默认的 页面#章节
  • 2(及更大数字)– 其他要链接的页面。与第一个参数一样自动格式化。
  • topic – 主题名称。如未指定,默认使用"本主题"。
  • selfref – 若设为"yes"、"y"、"true"或"1",添加 CSS 类"selfref"。用于表示对维基百科的自我提及。参见 Template:Selfref
  • category – 若设为"no"、"n"、"false"或"0",抑制错误跟踪分类(Category:有错误的顶注模板)。仅在省略第一个位置参数(要链接的页面)时有效。

示例

  • {{Broader|方剂学}}
  • {{Broader|方剂学|topic=中药学}}

错误

若未提供页面名称,模板将输出以下信息:

  • 错误:no page name specified(帮助)。

若看到此错误信息,可能是以下四种原因之一:

  1. 未指定任何参数(模板代码为 {{Broader}})。请改用 {{Broader|页面}}
  2. 指定了部分参数,但未包含页面名称。例如模板代码 {{Broader|selfref=yes}} 会产生此错误。请改用(例如){{Broader|页面|selfref=yes}}
  3. 指定了页面名称,但包含等号("=")。等号在模板代码中有特殊含义,因此不能用于未指定参数名的模板参数中。例如模板代码 {{Broader|2+2=4}} 会产生此错误。可通过在页面名称前加 1= 显式指定参数名(如 {{Broader|1=2+2=4}}),或用 双花括号包裹等号(如 {{Broader|2+2{{=}}4}})来避免等号被解释为参数名分隔符。

包含此错误信息的页面会归入 Category:有错误的顶注模板

参见