Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Template documentation (for the above template, sometimes hidden or invisible) [view] [edit] [history] [refresh]

Template:Documentation header Template:Shortcut This template can be used to allow linking to a section of an article without the creation of headers. Common use cases include use within larger tables and after renaming a section.

Usage

If {{anchor|Example}} is placed on the next line, then Template:Anchor#Example will link to that line.

For example, this code: <syntaxhighlight lang=wikitext> Template:Anchor Example anchor sentence. </syntaxhighlight> Produces:

Template:Anchor Example anchor sentence.

This template supports multiple parameters as well. So {{anchor|Example|Anchor|Test}} will create anchors "Example", "Anchor", and "Test" at the place of its usage.

Only thirteen anchors are supported in one call of the template, if you need any more, you will need to call a second instance of the template.

Multiple section heading anchors

This template can also be used for adding another anchor to a section heading, for example:

<syntaxhighlight lang=wikitext>

{{subst:anchor|Heading alias}} Heading

This is a content. </syntaxhighlight>

The code above creates "Heading alias" anchor precisely at "Heading" section. This enables editors linking either "Heading alias" or "Heading" to that section. This is useful when renaming a section heading, as the previous name might still be used for linking on other pages, and adding an anchor for it keeps the previous links working.

Remember to substitute correctly as to not cause any technical problems (see WP:ANCHORSUBST).

To add more anchor in the future, you may add the template after the span tag used to add the anchor:

<syntaxhighlight lang=wikitext>

{{subst:anchor|Another alias}} Heading

This is a content. </syntaxhighlight>

This is equivalent to <syntaxhighlight lang=wikitext inline>{{subst:anchor|Headling alias|Another alias}}</syntaxhighlight>.

See also

cs:Šablona:Anchor de:Vorlage:Anker es:Plantilla:Anclaje fr:Modèle:Anchor nl:Sjabloon:Anchor pt:Predefinição:Âncora ru:Шаблон:Якорь th:แม่แบบ:Anchor uk:Шаблон:Якір

zh:Template:Anchor
The above text is transcluded from Template:MC/Anchor/doc; you can change it or view its history.
If you're done making changes, please refresh the text.
Please add categories and interwikis to Template:MC/Anchor/doc. (View all subpages of this page.)