模板:Section link

来自戏曲百科

模板:Section link § Notes

💬 模板文档[查看] [编辑] [历史] [清除]

模板:Template shortcuts

用法

本模板适用于顶注和“参见”章节,或在同一篇文章中的“参考文献”章节。当在文章正文中使用时,请考虑到公开链接到另一篇文章中的特定章节是否会让那些无法点击链接的读者感到困惑,例如那些查看材料的印刷版或没有链接的重新发布版本的读者。

语法(概览)

单个章节

这个模板{{section link}},或者它的快捷方式{{slink}},用来生成指向到本地wiki页面的某个章节的链接,并呈现一个适当的分节符号(§)。

除了

[[阿尔伯特·爱因斯坦#主要科學成就]]

阿尔伯特·爱因斯坦#主要科學成就

取而代之的是:

{{section link|阿尔伯特·爱因斯坦|主要科學成就}}

阿尔伯特·爱因斯坦 § 主要科學成就

{{section link|阿尔伯特·爱因斯坦#主要科學成就}}

阿尔伯特·爱因斯坦 § 主要科學成就

多个章节

此模板可以生成指向同一页面的多个章节的连续链接。您可以写:

{{section link|阿尔伯特·爱因斯坦|宗教观|政治观|熱愛音樂}}

阿尔伯特·爱因斯坦 §§ 宗教观、​政治观​ 和 熱愛音樂

{{section link|阿尔伯特·爱因斯坦#宗教观|政治观|熱愛音樂}}

阿尔伯特·爱因斯坦 §§ 宗教观、​宗教观​ 和 熱愛音樂

禁用页面名称

有时,为了避免冗余和冗长,不需要出现页面名称。对于使用本模板的页面,不指定页面名称只会创建章节链接。例如:

{{Section link|禁用页面名称}}

相当于:

[[#禁用页面名称|§ 禁用页面名称]]

显示为

§ Suppressing page name

使用|nopage=y可达到同样的视觉效果。

显示结果的比较:

模板数据

这是用于新版可视化编辑器及其他工具的模板数据文档。

Section link模板数据

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 name1

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 12

Name of the (first) section to which the link must be created. This parameter is mandatory.

字符串必需
Section name 23

This template can link to additional sections within one page. You can supply another section name in this field.

字符串可选
Section name 34

This template can link to additional sections within one page. You can supply another section name in this field.

字符串可选
Section name 45

This template can link to additional sections within one page. You can supply another section name in this field.

字符串可选
Hide page namenopage

If set to "yes", "y" or "true", hides the page name (only section names are displayed).

布尔可选
Keep underscoreskeep-underscores

If set to "yes", "y" or "true", doesn't replace underscores with spaces in the page name and section names.

布尔可选
Displayed page namedisplay

If the page name must be displayed differently (e.g. in italics), enter it here.

字符串可选