Difference between revisions of "Template:Anchor"

From Starfleet Commander
Jump to navigationJump to search
(Created page with "<span id="{{{1|<span class="error">Required parameter missing.</span>}}}"></span><noinclude> ==Template documentation== The template {{anchor}} inserts one [http://en.wikipedia.o...")
 
m
Line 1: Line 1:
 
<span id="{{{1|<span class="error">Required parameter missing.</span>}}}"></span><noinclude>
 
<span id="{{{1|<span class="error">Required parameter missing.</span>}}}"></span><noinclude>
 
==Template documentation==
 
==Template documentation==
The template {{anchor}} inserts one [http://en.wikipedia.org/wiki/HTML_element#Anchor HTML anchors] in a page. The location can then be linked to using [[#link|...]] syntax.
+
The template {{Anchor}} inserts one [http://en.wikipedia.org/wiki/HTML_element#Anchor HTML anchors] in a page. The location can then be linked to using [[#link|...]] syntax.
  
 
===Examples===
 
===Examples===

Revision as of 22:15, 19 September 2011

<span id="Required parameter missing.">

Template documentation

The template <span id="Required parameter missing."> inserts one HTML anchors in a page. The location can then be linked to using ... syntax.

Examples

1. {{anchor|foo}}

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.

2. Anchors can be more suitable for inter-article linking than section titles are. For example,

== {{anchor|foo}} Section title ==
Here, links via [[articlename#foo]] would remain valid even if the section were renamed.

3. The template can be used to create up to ten anchors with a single call. For example,

{{anchor|foo|bar|baz}}
will create three anchors that can then be linked to with [[#foo]], [[#bar]] and [[#baz]].
Specifying more than 10 anchors will cause an error message to be displayed.{{#ifeq:Anchor|Visible anchor|


4. If the text to be displayed must differ from the anchor (e.g. because it contains brackets for linking), the text parameter can be used:

{{anchor|foo|text=[[foo]]}}
this will result in a link that constitutes an anchor of its own|}}