Template:Anchor

From 2009.igem.org

(Difference between revisions)
(Anchor template (hope it works).)
(Expanded on the explanation)
 
Line 1: Line 1:
<span id="{{{1}}}"></span><noinclude>
<span id="{{{1}}}"></span><noinclude>
-
This template manually adds an HTML anchor to a page at the location of its invocation.  
+
This template manually adds an HTML anchor to a page at the location of its invocation. This anchor can then be used to create a link to a specific part of a page.
Usage:
Usage:
<pre>{{anchor|foo}}</pre>
<pre>{{anchor|foo}}</pre>
 +
 +
The link can then be made as:
 +
<pre>[[#foo|My favourite part of this page]]</pre>
 +
 +
When using this with a section (to make an anchor that does not change with subsequent section renamings) it is a good idea to prepend the anchor to the title, this will make the browser open with the section title at the top of the window. For example:
 +
<pre>=={{anchor|UnchangingAnchor}} Changing Title==</pre>
</noinclude>
</noinclude>

Latest revision as of 12:23, 21 April 2009

This template manually adds an HTML anchor to a page at the location of its invocation. This anchor can then be used to create a link to a specific part of a page.

Usage:

{{anchor|foo}}

The link can then be made as:

[[#foo|My favourite part of this page]]

When using this with a section (to make an anchor that does not change with subsequent section renamings) it is a good idea to prepend the anchor to the title, this will make the browser open with the section title at the top of the window. For example:

=={{anchor|UnchangingAnchor}} Changing Title==