This site is supported by donations to The OEIS Foundation.

Template:Anchor/doc

From OeisWiki
Jump to: navigation, search

This documentation subpage contains instructions, categories, or other information for Template:Anchor. [<Edit> Template:Anchor]

[⧼Purge⧽ Template:Anchor/doc]

The {{anchor}} internal link template is used to create up to twelve invisible anchors which can be linked to (from either the same page or another page).

The following anchor could be linked to with [[#foo|...]] from within the same article, or it could be linked to with [[articlename#foo|...]] from other articles and from redirects.

{{anchor|foo}}

Invisible anchors can be more suitable for inter-article linking than section titles are, since the link would remain valid even if the section were renamed. Here, links via [[#foo]] or [[articlename#foo]] would remain valid even if the section were renamed. Also, invisible anchors are useful to create many aliases for a section.

Usage

Note: the anchor names are case sensitive (and that includes the first character of the anchor name!)

== {{anchor|foo}} Section title ==
== {{anchor|foo|bar}} Section title ==
== {{anchor|foo1|foo2|foo3|foo4|foo5|foo6|foo7|foo8|foo9|foo10|foo11|foo12}} Section title ==

Examples

Pachyderm example

The current section title wikitext being (without any space between {{anchor}} and section title)

== {{anchor|Elephant example|Mammoth example}} Pachyderm example ==

Template:Anchor#Elephant example and Template:Anchor#Mammoth example (from another page) or #Elephant example and #Mammoth example (from this page) will now link to the section called "Pachyderm example", as seen above. (Template:Anchor#Pachyderm example still works!)

The following examples won't find the anchor since the initial anchor character have the wrong case

Template:Anchor#elephant example and Template:Anchor#mammoth example (from another page) or #elephant example and #mammoth example (from this page) will now link to the section called "Pachyderm example", as seen above.

Code

<noinclude>{{Documentation}}</noinclude><includeonly><!--
-->{{#if: {{{1|}}}|<span class="anchor"  id="{{{1}}}"></span>}}<!--
-->{{#if: {{{2|}}}|<span class="anchor"  id="{{{2}}}"></span>}}<!--
-->{{#if: {{{3|}}}|<span class="anchor"  id="{{{3}}}"></span>}}<!--
-->{{#if: {{{4|}}}|<span class="anchor"  id="{{{4}}}"></span>}}<!--
-->{{#if: {{{5|}}}|<span class="anchor"  id="{{{5}}}"></span>}}<!--
-->{{#if: {{{6|}}}|<span class="anchor"  id="{{{6}}}"></span>}}<!--
-->{{#if: {{{7|}}}|<span class="anchor"  id="{{{7}}}"></span>}}<!--
-->{{#if: {{{8|}}}|<span class="anchor"  id="{{{8}}}"></span>}}<!--
-->{{#if: {{{9|}}}|<span class="anchor"  id="{{{9}}}"></span>}}<!--
-->{{#if:{{{10|}}}|<span class="anchor" id="{{{10}}}"></span>}}<!--
-->{{#if:{{{11|}}}|<span class="anchor" id="{{{11}}}"></span>}}<!--
-->{{#if:{{{12|}}}|<span class="anchor" id="{{{12}}}"></span>}}<!--
-->{{#if:{{{13|}}}| {{error| Anchor error: Too many anchors, maximum is 12. }} }}</includeonly>