Kentsmith9 (talk | contribs) (Moved category) |
Kentsmith9 (talk | contribs) (Updated instructions) |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{doc subpage}} | {{doc subpage}} | ||
This template creates a point on a page that can be linked from other pages. | This template creates a point on a page that can be linked from other pages. It works like the section headings without being displayed on the screen. | ||
== Use == | == Use == | ||
Line 8: | Line 8: | ||
<pre> | <pre> | ||
{{Anchor|Name for the link on the page}} | {{Anchor|Name for the link on the target page}} | ||
</pre> | </pre> | ||
Then from another page you can enter the code: | Then from another page you can enter the code: | ||
<pre> | <pre> | ||
<nowiki>[[</nowiki> | <nowiki>[[</nowiki>Target page#Name for the link on the target page<nowiki>]]</nowiki> | ||
</pre> | </pre> | ||
Line 19: | Line 19: | ||
<pre> | <pre> | ||
<nowiki>[[</nowiki>#Name for the link on the page<nowiki>]]</nowiki> | <nowiki>[[</nowiki>#Name for the link on the target page<nowiki>]]</nowiki> | ||
</pre> | </pre> | ||
Note that both entries can also use the pipe character (|) to display alternate text to the user instead of the actual link name. | Note that both entries can also use the pipe character (|) to display alternate text to the user instead of the actual link name. | ||
This template can be placed in the header sections. When doing so, add the template to the left of the visible section name to limit the problems noted in the limitations section below. | |||
== Parameters == | |||
There is a minimum of one parameter that must be included in the template. Additional links can be defined as additional text parameters separated by the pipe character (|) like the following: | |||
<pre> | |||
{{Anchor | First link name | Second link name | Third link name}} | |||
</pre> | |||
== Limitations == | |||
* Only 10 named links can be added to one anchor template. | |||
* Placement of the anchor template in '''section headings''' has some known side effects discussed in the [http://en.wikipedia.org/wiki/Template_talk:Anchor Wikipedia anchor template talk page]. The significant issues is that the summary description from editing sections have a broken link. However, if you do edit the section you can just remove that portion of the edit summary. Therefore it is considered acceptable to include the anchor template at the beginning of the text in a section heading. | |||
== Page display == | == Page display == | ||
Line 29: | Line 41: | ||
<includeonly> | <includeonly> | ||
<!-- ADD CATEGORIES BELOW THIS LINE --> | <!-- ADD CATEGORIES BELOW THIS LINE --> | ||
[[Category: | [[Category:Linking templates]] | ||
<!-- ADD INTERWIKIS BELOW THIS LINE --> | <!-- ADD INTERWIKIS BELOW THIS LINE --> | ||
</includeonly> | </includeonly> |
Latest revision as of 23:40, 15 August 2022
This is a documentation subpage for . It contains usage information, categories and other content that is not part of the original template page. |
This template creates a point on a page that can be linked from other pages. It works like the section headings without being displayed on the screen.
Use
Place the following example code on a page in the spot to which you need to link:
{{Anchor|Name for the link on the target page}}
Then from another page you can enter the code:
[[Target page#Name for the link on the target page]]
or if it is on the current page you can alternately use:
[[#Name for the link on the target page]]
Note that both entries can also use the pipe character (|) to display alternate text to the user instead of the actual link name.
This template can be placed in the header sections. When doing so, add the template to the left of the visible section name to limit the problems noted in the limitations section below.
Parameters
There is a minimum of one parameter that must be included in the template. Additional links can be defined as additional text parameters separated by the pipe character (|) like the following:
{{Anchor | First link name | Second link name | Third link name}}
Limitations
- Only 10 named links can be added to one anchor template.
- Placement of the anchor template in section headings has some known side effects discussed in the Wikipedia anchor template talk page. The significant issues is that the summary description from editing sections have a broken link. However, if you do edit the section you can just remove that portion of the edit summary. Therefore it is considered acceptable to include the anchor template at the beginning of the text in a section heading.
Page display
This template does not generate visible text in the Wiki page.