Difference between revisions of "Template:Article section/doc"
(→Usage) |
m (15 revisions imported) |
||
| (7 intermediate revisions by 4 users not shown) | |||
| Line 2: | Line 2: | ||
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | ||
== Usage == | == Usage == | ||
| − | This simple template is used to generate a link to a certain section of the current/associated '''article''' or other non-talk page, and render an appropriate section mark ([[§]]). This link points to a section of the article or page, even if it the template is used within that article's talk page | + | This simple template is used to generate a link to a certain section of the current/associated '''article''' or other non-talk page, and render an appropriate section mark ([[§]]). This link points to a section of the article or page, even if it the template is used within that article's talk page. |
| − | For example, instead of the following: | + | {{markup |
| − | :<code><nowiki>[[History of IBM#1969: Antitrust, the Unbundling of software and services|§ 1969: Antitrust, the Unbundling of software and services]]</nowiki></code> within [[Talk:History of IBM]] | + | |<nowiki>Are the dates in {{article section|Early life}} accurate? ~~~~</nowiki> |
| + | |Are the dates in {{article section|Early life}} accurate? [[User:Example]] 00:00, 1 January 2000 (UTC)}} | ||
| + | |||
| + | This template is meant to save the editors from writing the same thing twice. For example, instead of the following: | ||
| + | :<code><nowiki>[[History of IBM#1969: Antitrust, the Unbundling of software and services|§ 1969: Antitrust, the Unbundling of software and services]]</nowiki></code> within [[Talk:History of IBM]], or | ||
:<code><nowiki>[[#1969: Antitrust, the Unbundling of software and services|§ 1969: Antitrust, the Unbundling of software and services]]</nowiki></code> within [[History of IBM]] article | :<code><nowiki>[[#1969: Antitrust, the Unbundling of software and services|§ 1969: Antitrust, the Unbundling of software and services]]</nowiki></code> within [[History of IBM]] article | ||
| Line 17: | Line 21: | ||
:{{Section link|History of IBM|1969: Antitrust, the Unbundling of software and services|nopage=y}} | :{{Section link|History of IBM|1969: Antitrust, the Unbundling of software and services|nopage=y}} | ||
| − | ;Q{{ | + | ;Q{{colon}} What if the target anchor is different from what must be displayed?: A: This might happen if the section title contains characters that cannot appear in an HTML anchor or HTML ID. In that case, you are already in need of writing the ID and the display text separately; use of this template would be pointless as it only makes you type an additional "article section{{!}}". Stick to standard Wikipedia linking syntax. |
==See also== | ==See also== | ||
| Line 26: | Line 30: | ||
<templatedata> | <templatedata> | ||
{ | { | ||
| − | "description": "This simple template is used to generate a link to a certain section the current/associated article and render an appropriate section mark (§). This link points to a section of the article even if | + | "description": "This simple template is used to generate a link to a certain section the current/associated article and render an appropriate section mark (§). This link points to a section of the article even if the template is used within the article's talk page. This template is meant to save the editors from writing the same thing twice.", |
"params": { | "params": { | ||
"1": { | "1": { | ||
| Line 38: | Line 42: | ||
</templatedata> | </templatedata> | ||
| − | <includeonly>{{ | + | <includeonly>{{Sandbox other|| |
<!-- Categories below this line, please; interwikis at Wikidata --> | <!-- Categories below this line, please; interwikis at Wikidata --> | ||
| − | + | [[Category:Internal link templates]] | |
}}</includeonly> | }}</includeonly> | ||
Latest revision as of 14:41, 28 October 2020
| This is a documentation subpage for Template:Article section. It contains usage information, categories and other content that is not part of the original template page. |
Usage
This simple template is used to generate a link to a certain section of the current/associated article or other non-talk page, and render an appropriate section mark (§). This link points to a section of the article or page, even if it the template is used within that article's talk page.
| Markup | Renders as |
|---|---|
Are the dates in {{article section|Early life}} accurate? ~~~~
|
Are the dates in Script error: No such module "Section link". accurate? User:Example 00:00, 1 January 2000 (UTC) |
This template is meant to save the editors from writing the same thing twice. For example, instead of the following:
[[History of IBM#1969: Antitrust, the Unbundling of software and services|§ 1969: Antitrust, the Unbundling of software and services]]within Talk:History of IBM, or[[#1969: Antitrust, the Unbundling of software and services|§ 1969: Antitrust, the Unbundling of software and services]]within History of IBM article
...you can write:
{{Article section|1969: Antitrust, the Unbundling of software and services}}
...which is much shorter and does not require you to search for the section mark character.
Both generate:
- Script error: No such module "Section link".
- Q: What if the target anchor is different from what must be displayed?
- A: This might happen if the section title contains characters that cannot appear in an HTML anchor or HTML ID. In that case, you are already in need of writing the ID and the display text separately; use of this template would be pointless as it only makes you type an additional "article section|". Stick to standard Wikipedia linking syntax.
See also
- {{Section link}}
TemplateData
TemplateData for Article section
This simple template is used to generate a link to a certain section the current/associated article and render an appropriate section mark (§). This link points to a section of the article even if the template is used within the article's talk page. This template is meant to save the editors from writing the same thing twice.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Section name | 1 | Name of the section in the current/associated article to which you'd like to link. | String | required |