Template:Anchor

From Cassette Beasts

The Anchor template creates a new anchor that can be used for linking to sections or specific regions of a page.

Parameters

1
Name of the anchor. Will be encoded into an anchor string using the {{anchorencode:}} magic word.
2
(optional)
The text with which the anchor should be created. Leave this blank to make the anchor invisible.

Usage

(See the MediaWiki help on link anchors for details)

When used, this template produces a <span> element that has the specified anchor name. For example, the template call {{Anchor|My custom anchor}} produces the following output:

<span class="anchor" id="My_custom_anchor"></span>

This anchor can then be linked to using the link [[#My_custom_anchor|Link to my custom anchor]]. Note that the link destination uses the anchor-encoded anchor name. To make this conversion easier and less error-prone, you can also use Template:AnchorLink.