用法
本模板适用于顶注和“参见”章节,或在同一篇文章中的“参考文献”章节。当在文章正文中使用时,请考虑到公开链接到另一篇文章中的特定章节是否会让那些无法点击链接的读者感到困惑,例如那些查看材料的印刷版或没有链接的重新发布版本的读者。
语法(概览)
{{section link|条目|章节}}
或{{section link|条目#章节}}
,链接到另一个条目的章节 → 示例: 有兽焉 § 主要角色{{section link|条目|章节|nopage=y}}
,链接到另一个条目的章节,仅显示章节的标题 → 示例:§ 主要角色{{section link||章节}}
,为了在同一页面中使用,请将第一个参数留空 → 示例:§ 主要角色
单个章节
这个模板{{section link}},或者它的快捷方式{{slink}},用来生成指向到本地wiki页面的某个章节的链接,并呈现一个适当的分节符号(§)。
除了
[[有兽焉#主要角色]]
取而代之的是:
{{section link|有兽焉|主要角色}}
或
{{section link|有兽焉#主要角色}}
多个章节
此模板可以生成指向同一页面的多个章节的连续链接。您可以写:
{{section link|有兽焉|四不像|兔爷|天禄}}
或
{{section link|有兽焉#四不像|兔爷|天禄}}
禁用页面名称
有时,为了避免冗余和冗长,不需要出现页面名称。对于使用本模板的页面,不指定页面名称只会创建章节链接。例如:
{{Section link||禁用頁面名稱}}
相当于:
[[#禁用页面名称|§ 禁用页面名称]]
显示为
使用|nopage=y
可达到同样的视觉效果。
显示结果的比较:
{{section link|四不相|困兽岛}}
→ 四不相 § 困兽岛{{section link|有兽焉|四不像|nopage=y}}
→ § 四不像{{section link|有兽焉|四不像|兔爷|天禄}}
→ 有兽焉 §§ 四不像、兔爷 和 天禄{{section link|有兽焉|四不像|兔爷|天禄|nopage=y}}
→ §§ 四不像、兔爷 和 天禄
模板数据
This template is used to generate a link to a certain section of a local wiki page and render an appropriate section mark (§). This template may generate consecutive links to several sections of the same page.
参数 | 描述 | 类型 | 状态 | |
---|---|---|---|---|
Page name | 1 | Name of the page to which the link must be created. Leave empty to link to the current page. Doing so causes no page name to appear. | 页面名称 | 推荐 |
Section name 1 | 2 | Name of the (first) section to which the link must be created. This parameter is mandatory. | 字符串 | 必需 |
Section name 2 | 3 | This template can link to additional sections within one page. You can supply another section name in this field. | 字符串 | 可选 |
Section name 3 | 4 | This template can link to additional sections within one page. You can supply another section name in this field. | 字符串 | 可选 |
Section name 4 | 5 | This template can link to additional sections within one page. You can supply another section name in this field. | 字符串 | 可选 |
Hide page name | nopage | If set to "yes", "y" or "true", hides the page name (only section names are displayed). | 布尔 | 可选 |
Keep underscores | keep-underscores | If set to "yes", "y" or "true", doesn't replace underscores with spaces in the page name and section names. | 布尔 | 可选 |
Displayed page name | display | If the page name must be displayed differently (e.g. in italics), enter it here. | 字符串 | 可选 |