Template:Anchor

From SRB2 Wiki
Jump to navigation Jump to search


Usage

Use to create a section link that is independent of a section title. See also Special:Whatlinkshere/Template:Anchor. Copied over from Wikipedia, see Template:Anchor.

1. {{anchor|Foo}}

could be linked to with [[#Foo...]] from within the same article,
or it could be linked to with [[Article name#Foo|…]] from other articles and from redirects.

2. Anchors can be more suitable for inter-article linking than section titles are. For example:

== {{anchor|Foo}} Section title ==
Here, links via [[Article name#Foo]] would remain valid even if the section were renamed.
The following is an example of what not to do:
== Section title {{anchor|Bar}} ==
Here, the link [[Article name#Bar]] would take the user to the section, but could undesirably hide the section title from view.

3. The template can be used to create up to ten anchors with a single call. For example,

{{anchor|Foo|Bar|baz}}
will create three anchors that can then be linked to with [[#Foo]], [[#Bar]] and [[#baz]].
Specifying more than 10 anchors will cause an error message to be displayed.