Template:Section link/doc

Usage[edit]

This template is appropriate for use in hatnotes and See also sections, or to reference sections within the same article. When using in article body text, consider whether an overt link to a specific section in another article may be confusing to readers who cannot follow links, such as those viewing a printed version of the material, or a version republished without links.

Syntax (overview)[edit]

Single section[edit]

This template, {{section link}}, or its shortcut, {{slink}}, is used to generate a link to a certain section of a local wiki page and render an appropriate section mark (§).

Instead of:

[[Help:Line break handling#Preventing and controlling word wraps]]

Help:Line break handling#Preventing and controlling word wraps

...you can write:

{{section link|Help:Line break handling|Preventing and controlling word wraps}}

Help:Line break handling § Preventing and controlling word wraps

...or

{{section link|Help:Line break handling#Preventing and controlling word wraps}}

Help:Line break handling § Preventing and controlling word wraps

Multiple sections[edit]

This template may generate consecutive links to several sections of the same page. You can write:

{{section link|Help:Line break handling|Causing line breaks|Preventing and controlling word wraps}}
Help:Line break handling §§ Causing line breaks​ and Preventing and controlling word wraps

Suppressing page name[edit]

Sometimes the page name needs not to appear (e.g. to avoid redundancy and wordiness). For the page on which the template is used, not specifying a page name creates a section link only. The following:

{{Section link||Suppressing page name}}

...is the equivalent of:

[[#Suppressing page name|§ Suppressing page name]]

...and renders as:

§ Suppressing page name

Use |nopage=y for the same visual effect.

When discussing an article from its talk page, {{Article link}}—or its alias, {{alink}}—is preferable to the longer {{Section link|{{ARTICLEPAGENAME}}|Section|nopage=y}}.

Comparison of displayed results:

TemplateData[edit]

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.

Template parameters

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

Pagesuggested
Section name 12

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

Stringrequired
Section name 23

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

Stringoptional
Section name 34

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

Stringoptional
Section name 45

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

Stringoptional
Hide page namenopage

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

Booleanoptional
Keep underscoreskeep-underscores

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

Booleanoptional
Displayed page namedisplay

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

Stringoptional

See also[edit]

  • U+00A7 § SECTION SIGN
  • {{Anchor}}
  • {{Article link}} – for linking to a mainspace section from its talk page
  • {{Multi-section link}} – for linking to a section listing nested section names
  • {{Pslink}} – for linking to a section without displaying the section sign (§)