Template:Anchor View history

(Documentation)
(Expanded anchor support)
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>'''Documentation:''' This template creates a point on a page that can be linked from other pages. Place the following example code on a page in the spot to which you need to link:
{{#if:{{{1|}}}|<span id="{{{1|}}}"></span>}}<!--
-->{{#if:{{{2|}}}|<span id="{{{2|}}}"></span>}}<!--
-->{{#if:{{{3|}}}|<span id="{{{3|}}}"></span>}}<!--
-->{{#if:{{{4|}}}|<span id="{{{4|}}}"></span>}}<!--
-->{{#if:{{{5|}}}|<span id="{{{5|}}}"></span>}}<!--
-->{{#if:{{{6|}}}|<span id="{{{6|}}}"></span>}}<!--
-->{{#if:{{{7|}}}|<span id="{{{7|}}}"></span>}}<!--
-->{{#if:{{{8|}}}|<span id="{{{8|}}}"></span>}}<!--
-->{{#if:{{{9|}}}|<span id="{{{9|}}}"></span>}}<!--
-->{{#if:{{{10|}}}|<span id="{{{10|}}}"></span>}}<!--
-->{{#if:{{{11|}}}|<span class="error">Error in [[Template:Anchor]]: too many anchors, maximum is 10.</span>}}<noinclude>


'''<nowiki>{{</nowiki>anchor|Name for the link on the page<nowiki>}}</nowiki>'''
{{Documentation}}
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
Then from another page you can enter the code:
</noinclude>
 
'''<nowiki>[[</nowiki>PageNameWithNewAnchor#Name for the link on the page<nowiki>]]</nowiki>'''
 
or if it is on the current page you can alternately use:
 
'''<nowiki>[[</nowiki>#Name for the link on the page<nowiki>]]</nowiki>'''
 
Note that both entries can also use the pipe (|) to display alternate text to the user instead of the actual link name.
 
The following content after the line will appear on the actual page.
----
 
</noinclude><span id="{{{1|}}}"></span>

Revision as of 21:19, 14 March 2014


Documentation icon Template documentation[view] [edit] [history] [purge]

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 page}}

Then from another page you can enter the code:

[[PageNameWithNewAnchor#Name for the link on the page]]

or if it is on the current page you can alternately use:

[[#Name for the link on the page]]

Note that both entries can also use the pipe character (|) to display alternate text to the user instead of the actual link name.

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. Generally it is OK 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.

The above documentation is transcluded from Template:Anchor/doc.
Please add categories to the /doc subpage.
Subpages of this template.