<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://www.verzauberte-welten.de/index.php?action=history&amp;feed=atom&amp;title=Vorlage%3AAnchor%2Fdoc</id>
	<title>Vorlage:Anchor/doc - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://www.verzauberte-welten.de/index.php?action=history&amp;feed=atom&amp;title=Vorlage%3AAnchor%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://www.verzauberte-welten.de/index.php?title=Vorlage:Anchor/doc&amp;action=history"/>
	<updated>2026-04-05T15:39:45Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Verzauberte Welten e.V.</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://www.verzauberte-welten.de/index.php?title=Vorlage:Anchor/doc&amp;diff=42&amp;oldid=prev</id>
		<title>mw&gt;Oetterer am 3. Februar 2015 um 13:32 Uhr</title>
		<link rel="alternate" type="text/html" href="https://www.verzauberte-welten.de/index.php?title=Vorlage:Anchor/doc&amp;diff=42&amp;oldid=prev"/>
		<updated>2015-02-03T13:32:04Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Documentation subpage}}&lt;br /&gt;
{{lua|Module:Anchor}}&lt;br /&gt;
&amp;lt;!-- PLEASE ADD CATEGORIES AND INTERWIKIS LINKS AT THE END OF THIS PAGE --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The template &amp;lt;nowiki&amp;gt;{{&amp;lt;/nowiki&amp;gt;[[{{ns:Template}}:{{BASEPAGENAME}}|{{lc:{{BASEPAGENAME}}}}]]&amp;lt;nowiki&amp;gt;}}&amp;lt;/nowiki&amp;gt; inserts one or more [[wpen:Fragment identifier|HTML fragment identifiers]] (anchor names) in a page. Those locations can then be linked to using &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[#Location|…]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; syntax. {{#ifeq:{{BASEPAGENAME}}|Visible anchor|&amp;amp;nbsp;Unlike {{tl|Anchor}}, the first parameter will be visible text on the page.|}} (Usually the first letter of the ''location'' is capitalised to reflect the common capitalisation used in section headers – see [[wpen:MOS:HEAD|MOS:HEAD]].)&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;code style=&amp;quot;color:darkgreen;&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;{{&amp;lt;/nowiki&amp;gt;{{lc:{{BASEPAGENAME}}}}|Foo&amp;lt;nowiki&amp;gt;}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &lt;br /&gt;
: could be linked to with &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;[[#Foo|…]]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; from within the same article, &lt;br /&gt;
: or it could be linked to with {{nowrap|&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;[[&amp;lt;/nowiki&amp;gt;''&amp;lt;small&amp;gt;Article name&amp;lt;/small&amp;gt;''#Foo&amp;lt;nowiki&amp;gt;|…]]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;}} from other articles and from redirects.&lt;br /&gt;
&lt;br /&gt;
2. Anchors can be more suitable for inter-article linking than section titles are. For example: &lt;br /&gt;
:{{nowrap|1=&amp;lt;code style=&amp;quot;color:dimgray;&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;==&amp;lt;/nowiki&amp;gt;&amp;lt;span&amp;gt;{{nbsp}}&amp;lt;/span&amp;gt;&amp;lt;code style=&amp;quot;color:darkgreen;&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;{{&amp;lt;/nowiki&amp;gt;{{lc:{{BASEPAGENAME}}}}&amp;lt;nowiki&amp;gt;|Foo}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;span&amp;gt;{{nbsp}}&amp;lt;/span&amp;gt;Section title &amp;lt;nowiki&amp;gt;==&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;}} &lt;br /&gt;
:Here, links via {{nowrap|1=&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;[[&amp;lt;/nowiki&amp;gt;''Article name''#Foo&amp;lt;nowiki&amp;gt;]]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;}} would remain valid even if the section were renamed. (Note that the anchor is placed ''before'' the section name; otherwise browsers may hide the section title from view.) However, as noted under [[#Limitations|Limitations]] below, it may be preferable to use direct HTML rather than the template within section titles: &lt;br /&gt;
:{{nowrap|1=&amp;lt;code style=&amp;quot;color:dimgray;&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;==&amp;lt;/nowiki&amp;gt;&amp;lt;span&amp;gt;{{nbsp}}&amp;lt;/span&amp;gt;&amp;lt;code style=&amp;quot;color:darkgreen;&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;span id=&amp;quot;Foo&amp;quot; /&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;span&amp;gt;{{nbsp}}&amp;lt;/span&amp;gt;Section title &amp;lt;nowiki&amp;gt;==&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;}} &lt;br /&gt;
&lt;br /&gt;
3. The template can be used to create multiple anchors with a single call. For example, &lt;br /&gt;
: {{nowrap|1=&amp;lt;code style=&amp;quot;color:darkgreen;&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;{{&amp;lt;/nowiki&amp;gt;{{lc:{{BASEPAGENAME}}}}&amp;lt;nowiki&amp;gt;|Foo|Bar|baz}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;}} &lt;br /&gt;
:will create three anchors that can then be linked to with &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;[[#Foo]]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;[[#Bar]]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;[[#baz]]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:right&amp;quot;&lt;br /&gt;
!Character&lt;br /&gt;
![[wpen:Character entity reference|Code]]&lt;br /&gt;
!Template&lt;br /&gt;
!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;quot;&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;amp;amp;quot;&amp;lt;/code&amp;gt; &amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;&amp;amp;amp;#34;&amp;lt;/code&amp;gt;&lt;br /&gt;
|{{N/a}}&lt;br /&gt;
|(double)&amp;amp;nbsp;[[wpen:quotation mark]]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;#35;&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;amp;amp;#35;&amp;lt;/code&amp;gt;&lt;br /&gt;
|{{N/a}}&lt;br /&gt;
|[[wpen:Number sign|hash]]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;#124;&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;amp;amp;#124;&amp;lt;/code&amp;gt;&lt;br /&gt;
|{{tl|!}}&lt;br /&gt;
|[[wpen:Vertical bar|pipe]]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;#61;&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;amp;amp;#61;&amp;lt;/code&amp;gt;&lt;br /&gt;
|{{tl|{{=}}}}&lt;br /&gt;
|[[wpen:Equals sign|equals]]&lt;br /&gt;
|}&lt;br /&gt;
* Anchor names that contain any character shown in the table on the right will not work as expected. However, any of these characters can be replaced with the &amp;quot;&amp;amp;amp;#&amp;quot; codes shown for them here. Or, the pipe symbol and equals sign can be worked around with {{tl|!}} and {{tl|{{=}}}}, respectively. Markup code such as {{tag|sup|o}} and {{tag|sub|o}} (superscript and subscript) cannot be used. Most other characters, including white space and punctuation, are not a problem.&lt;br /&gt;
* Anchor names should be unique on a page, and should not duplicate any heading titles. Duplicate anchors will not work as expected since the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#location&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; links go to the first anchor with that name. Duplicate anchors result in invalid HTML; you can check for duplicate anchors by running the page through the [[wpen:W3C Markup Validation Service|W3C Markup Validation Service]].&lt;br /&gt;
* If the template is added to a section title then the code will appear in the edit summary window when that section is edited, as in {{nowrap|1=&amp;quot;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;/* {{anchor|Issues}}Limitations */ New issue&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;quot;}}. Also, when the section is saved, browsers may not return to the section. Consider using &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;span id=&amp;quot;...&amp;quot; /&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; directly, rather than using the anchor template, when in a section title. &lt;br /&gt;
* Anchor links are case sensitive in some browsers, so treat all anchor links as case sensitive.&lt;br /&gt;
&lt;br /&gt;
===Use in tables===&lt;br /&gt;
Anchors may be used within tables, subject to certain restrictions. The {{tlx|anchor}} template may be used in the caption and cells of a table, but not those portions of a table that are outside the caption and cells. It is used on the table's caption thus:&amp;lt;source enclose=div lang=text&amp;gt;|+ {{anchor|FooX}} A table caption&amp;lt;/source&amp;gt; and the following forms of cell are valid:&amp;lt;source enclose=div lang=text&amp;gt;!{{anchor|Foo1}} A header cell&lt;br /&gt;
!style=&amp;quot;background:white;&amp;quot; |{{anchor|Foo2}} A header cell with styling&lt;br /&gt;
|{{anchor|Foo3}} A data cell&lt;br /&gt;
|rowspan=2 |{{anchor|Foo4}} A data cell spanning two rows&amp;lt;/source&amp;gt; You need to ensure that the {{tlx|anchor}} is not in that portion of the markup intended for the classes, styles etc. Thus, {{tlx|anchor}} cannot be placed anywhere on lines that begin with &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{|&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; (start of table) or &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;|-&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; (new row), and the following forms of cell are not valid:&amp;lt;source enclose=div lang=text&amp;gt;!{{anchor|Foo1}} |A header cell&lt;br /&gt;
!style=&amp;quot;background:white;&amp;quot; {{anchor|Foo2}} |A header cell with styling&lt;br /&gt;
|{{anchor|Foo3}} |A data cell&lt;br /&gt;
|rowspan=2 {{anchor|Foo4}} |A data cell spanning two rows&amp;lt;/source&amp;gt; If it is necessary for an anchor to be in any of these positions, a different technique is used - the &amp;lt;code&amp;gt;id=&amp;lt;/code&amp;gt; attribute. This is placed in that portion of the markup where the classes, styles etc. may be used, as follows:&amp;lt;source enclose=div lang=text&amp;gt;{| id=FooX class=wikitable&lt;br /&gt;
|- id=FooY&lt;br /&gt;
!id=Foo1 |A header cell&lt;br /&gt;
!style=&amp;quot;background:white;&amp;quot; id=Foo2 |A header cell with styling&lt;br /&gt;
|id=Foo3 |A data cell&lt;br /&gt;
|rowspan=2 id=Foo4 |A data cell spanning two rows&amp;lt;/source&amp;gt; The &amp;lt;code&amp;gt;id=&amp;lt;/code&amp;gt; attribute may appear before, between or after any other attributes that may be present, but only one &amp;lt;code&amp;gt;id=&amp;lt;/code&amp;gt; attribute may be used in each of these areas.&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
* [[WP:ANCHOR]]&lt;br /&gt;
* [[WP:TARGET]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox||&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- CATEGORIES AND INTERWIKIS LINKS HERE, THANKS --&amp;gt;&lt;br /&gt;
[[Category:Utility templates]]&lt;br /&gt;
&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>mw&gt;Oetterer</name></author>
	</entry>
</feed>