UtterAccess HomeUtterAccess Wiki

Welcome Guest ( Log In | Register )

Custom Search
Edit Discussion
> Help:Anchors    
Anchors (Help)


Related Content:
    Help:Linking

An anchor is an html element that links to specific locations within a page. For wiki purposes, anchors tend to be useful for headings. Each heading is automatically given an anchor with the same name as the heading. This is used by the wiki page's Table of Contents, but they can also be referenced from anywhere else in the article (or any other article or url). Additionally, custom anchors can be applied in the wiki markup.

Contents

Overview

Anchors work by creating a reference and supplying an ID, which are referred to elsewhere through a link. The ID used to create the anchor is what must be referenced from the link. Anchor IDs must be unique within the scope of the page where it resides. For example, two anchor IDs of "ThisAnchor" would not be allowed in the same wiki page.


Defining Anchors

Anchors can be defined inherently through creating a Heading, manually by inserting a div tag, or by using the Anchor template. For wiki markup, the Anchor template is the preferred method for custom anchors, though the manual div tag method will be described here as well.

Heading Definitions

Anchors to Headings are automatically defined when a Heading is included in the markup. The Anchor ID is the same as the Heading text. Problems may arise when a heading text is changed, if any references to the heading are used for linking. For this reason, it may be advisable to include a specified anchor at a heading to ensure that if the heading is changed, external links are not broken. Note that page Table of Contents are automatically updated if the heading text is changed.

Manual Definitions

Anchors can be created manually by creating a set of div tags and supplying an ID as well as optional display text. Hidden anchors are created by omitting text between the div tags.

<div id="HiddenAnchor"></div>

<div id="VisibleAnchor">This is the visible text that will be linked to by calling the VisibleAnchor id</div>

Anchor Template Definitions

The Anchor Template provides a template-formatted means of including the div tag pair for creation of anchors. The first parameter is the ID, and the second, optional parameter is the text to display (to insert a hidden anchor, omit the second parameter)

{{Anchor|HiddenAnchorID}}

{{Anchor|VisibleAnchorID|Text to display}}


Calling Anchors

Anchors can be linked to using the wiki markup linking, or by standard url syntax. The anchor portion of a link is denoted by using the octathorpe (#) followed by the anchor's ID.

Same Page Linking

To link to an anchor that resides in the same page, use the wiki double-bracket link syntax, less the page name:

[[#AnchorID]]

[[#AnchorID|Optional Display Text]]

External Wiki Page Linking

To link to an anchor that resides in a different wiki page than the one which you're linking from, include the page name as you would for a standard link, followed by the anchor syntax:

[[ThisPage#ThisAnchor]]

[[ThisPage#ThisAnchor|Optional Display Text]]

External Website Anchor Linking

Linking to an anchor that resides in an external website is accomplished by adding the anchor syntax to the end of the url (convert spaces to underscores)

http://www.ThisWebsite.com/ThisPage.html#This_AnchorID
Edit Discussion
Custom Search
Thank you for your support!
This page has been accessed 2,586 times.  This page was last modified 14:56, 12 January 2012 by Jack Leach.   Disclaimers