This page last changed on Jun 01, 2009 by ggaskell.


The Anchor Macro allows you to link to specific parts of a page. Anchor links can be especially useful when navigating between sections of a long document or when you want to link to a segment of a page and not to the page as a whole.

Anchors are invisible to the reader when the page is rendered.

Anchors are made up of two parts:

  • The link
  • The content to which you are linking.

On this page:

Usage with the Macro Browser

To insert the anchor macro into a page using the Macro Browser,

  1. Open your desired Confluence page, then click the 'Edit' button. The 'Edit Page' mode opens.
  2. Next, click the Macro Browser icon on the editor toolbar. The Macro Browser will open in the middle of the screen.
  3. In the Macro Browser, type the name of your desired macro into the search box at the top right of the window. Macros with a matching name will appear in the centre pane. Click on the desired macro to see its options screen. Here, you can set the macro parameters then click 'insert' to put the macro into the page.

Once you've found the anchor macro, click 'insert' to add it to your page.

Usage with the Wiki Markup Editor

The following code creates an anchor called "here", but you can substitute this with whatever name you like.

{anchor:here}

Once an anchor is in the page, you can link to it by putting #here (or whatever anchor name you choose) at the end of a link pointing to that page.

Parameters

Parameters are settings for Confluence macros that allow the user to control their content or presentation. The table below lists relevant parameters for this macro.

Parameter names are displayed differently in the macro browser interface and in wiki markup. Below, parameter names used in the macro browser are indicated in Bold text, while their equivalents in wiki markup are indicated in (bracketed) text. If the latter is not shown, then in wiki markup, the parameter's name should be omitted and only its value should be added immediately after the colon symbol (:).

Parameter Default Description
Anchor Name
(anchor)
None; name must be supplied This is the name of the anchor that you will link to.

Examples

In the next example, there are two anchors in this page called "top" and "bottom", which you can link to like so:

[#top]
[#bottom]

These links come out like this: top bottom.

More examples follow.


Linking to an anchor in the same page

[#anchorname]

Linking to an anchor in another page

[nameofpage#anchorname]

Linking to an anchor in a page in another space

[spacekey:nameofpage#anchorname]

Linking to headings

Confluence treats all headings as anchors. So you don't have to place an anchor but simply link to it like this:

[#textofheading]

Warning
Page titles and links to other spaces can be combined with anchors and attachments, but you can't use attachments and anchors in the same link.

Note that if you are adding an anchor to the site welcome message, it must be to another page. Internal-only links such as {anchor:bottom} will not render.

RELATED TOPICS

Working with Links Overview

Take me back to the Confluence User Guide.

Document generated by Confluence on Dec 10, 2009 18:45