Changes

Jump to navigation Jump to search
add {{documentation subpage}}
{{documentation subpage}}
{{Redirect|Template:Slink|the template that links to search results|Template:Search link}}
{{template shortcuts|slink|§l}}
{{lua|Module:Section link}}

== Usage ==
This template is intended primarily for use in [[Wikipedia:Hatnote|hatnotes]]. It should not be used in running body text.

=== Syntax (overview) ===
* <code><nowiki>{{section link|Article|Section}}</nowiki></code> or <code><nowiki>{{section link|Article#Section}}</nowiki></code>, link to section of other article. → Example: {{section link|Albert Einstein|Scientific career}}
* <code><nowiki>{{section link|Article|Section|nopage=y}}</nowiki></code>, link to section of other article, only displaying the section's title → Example: {{section link|Albert Einstein|Scientific career|nopage=y}}
* <code><nowiki>{{section link||Section}}</nowiki></code>, for usage within the same article, supply an empty first parameter → Example: {{section link||Scientific career}}

=== Single section ===

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

Instead of:

<code><nowiki>[[Albert Einstein#Scientific career]]</nowiki></code>

[[Albert Einstein#Scientific career]]

...you can write:

<code><nowiki>{{section link|Albert Einstein|Scientific career}}</nowiki></code>

{{section link|Albert Einstein|Scientific career}}

...or

<code><nowiki>{{section link|Albert Einstein#Scientific career}}</nowiki></code>

{{section link|Albert Einstein#Scientific career}}

=== Multiple sections ===

This template may generate consecutive links to several sections of the same page. You can write:
<source lang=moin>{{section link|History of IBM|1880s–1924: The origin of IBM|1969: Antitrust, the Unbundling of software and services|1993–present: IBM's near disaster and rebirth}}</source>
:{{section link|History of IBM|1880s–1924: The origin of IBM|1969: Antitrust, the Unbundling of software and services|1993–present: IBM's near disaster and rebirth}}

...or:

<source lang=moin>{{section link|History of IBM#1880s–1924: The origin of IBM|1969: Antitrust, the Unbundling of software and services|1993–present: IBM's near disaster and rebirth}}</source>
:{{section link|History of IBM#1880s–1924: The origin of IBM|1969: Antitrust, the Unbundling of software and services|1993–present: IBM's near disaster and rebirth}}

===Suppressing page name===
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:
<pre>{{Section link||Suppressing page name}}</pre>
...is the equivalent of:
<pre>[[#Suppressing page name|§ Suppressing page name]]</pre>
...and renders as:
:{{section link||Suppressing page name}}

For other pages, {{para|nopage|y}} can be used to suppress the page name. This can be used when the page name is clear from context, such as on talk pages referring to the article being discussed.

This common case can be entered using {{tlc|Section link|{<nowiki/>{[[Help:Magic_words#Variables|ARTICLEPAGENAME]]}<nowiki/>}|Section|4=nopage=y}}. The template {{tlx|Article link}}, alias {{tlx|alink}}, exists for this purpose.

Comparison of displayed results:
*<code><nowiki>{{section link|WP:Manual of Style|Quotations}}</nowiki></code> → {{section link|WP:Manual of Style|Quotations}}
*<code><nowiki>{{section link|WP:Manual of Style|Quotations|nopage=y}}</nowiki></code> → {{section link|WP:Manual of Style|Quotations|nopage=y}}
*<code><nowiki>{{section link|WP:Manual of Style|Quotations|Quotation marks|Commas}}</nowiki></code> → {{section link|WP:Manual of Style|Quotations|Quotation marks|Commas}}
*<code><nowiki>{{section link|WP:Manual of Style|Quotations|Quotation marks|Commas|nopage=y}}</nowiki></code> → {{section link|WP:Manual of Style|Quotations|Quotation marks|Commas|nopage=y}}

=== Styling page name ===
For some page names (e.g., titles of films or short stories) we're [[MOS:DABPIPING|always]] supposed to present the core part of the page's name (without any parenthetic disambiguation) in italics, quotation marks, or some other markup (per [[MOS:TITLES]]). The {{para|display}} parameter can be used for this purpose:
*<code><nowiki>{{section link|The Last Temptation of Christ (film)|General controversy|display=''The Last Temptation of Christ'' (film)}}</nowiki></code> → {{section link|The Last Temptation of Christ (film)|General controversy|display=''The Last Temptation of Christ'' (film)}}

==TemplateData==
{{TemplateDataHeader}}
<templatedata>
{
"description": "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.",
"params": {
"1": {
"label": "Page name",
"description": "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.",
"type": "wiki-page-name",
"suggested": true
},
"2": {
"label": "Section name 1",
"description": "Name of the (first) section to which the link must be created. This parameter is mandatory.",
"type": "string",
"required": true
},
"3": {
"label": "Section name 2",
"description": "This template can link to additional sections within one page. You can supply another section name in this field.",
"type": "string"
},
"4": {
"label": "Section name 3",
"description": "This template can link to additional sections within one page. You can supply another section name in this field.",
"type": "string"
},
"5": {
"label": "Section name 4",
"description": "This template can link to additional sections within one page. You can supply another section name in this field.",
"type": "string"
},
"nopage": {
"label": "Suppress page name?",
"description": "If set to \"yes\", \"y\" or \"true\", suppresses the page name.",
"type": "boolean",
"autovalue": "y"
},
"display": {
"label": "Displayed title override",
"description": "If the article title must be displayed specially (e.g. in italics), enter it here.",
"type": "string"
}
}
}
</templatedata>

==See also==
*{{tl|Multi-section link}}{{snd}}for linking to a section listing nested section names

<includeonly>{{Sandbox other||
<!-- CATEGORIES HERE, THANKS -->
[[Category:Section and anchor link formatting templates]]
[[Category:Wikipedia section templates]]

}}</includeonly>
Anonymous user

Navigation menu