|
|
Anchors (Help)
Related Content: 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.
[edit] OverviewAnchors 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.
[edit] Defining AnchorsAnchors 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. [edit] Heading DefinitionsAnchors 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. [edit] Manual DefinitionsAnchors 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.
[edit] Anchor Template DefinitionsThe 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)
[edit] Calling AnchorsAnchors 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. [edit] Same Page LinkingTo link to an anchor that resides in the same page, use the wiki double-bracket link syntax, less the page name:
[edit] External Wiki Page LinkingTo 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:
[edit] External Website Anchor LinkingLinking 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)
|
| This page was last modified 14:56, 12 January 2012. This page has been accessed 150 times. Disclaimers |