模板:Section link/doc

模板頁面

Template:Template shortcuts

用法

本模板適用於頂注和「參見」章節,或在同一篇文章中的「參考文獻」章節。當在文章正文中使用時,請考慮到公開連結到另一篇文章中的特定章節是否會讓那些無法點擊連結的讀者感到困惑,例如那些查看材料的印刷版或沒有連結的重新發佈版本的讀者。

語法(概覽)

  • {{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模板資料

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.

字串非必填