How to link to an anchor on the page?

I have created an anchor on a page as follows

{anchor:here}

But I am unable to link to the above anchor. I am using Confluence 3.4.8. When I write the following markup in the rich text editor it displays the text as-is rather than showing it as a link to anchor.

[#here]

Am I missing something?

3 answers

You cannot simply past the markup in the Rich Text editor. You need to select the "Insert Macro" tool bar button (looks like a little scroll), choose the Anchor macro and then enter your anchor label as the target, with # preceeding. Then I believe the best choice is to insert your hyperlink using the Link macro.

My anchor has been created properly because when I save page and see the view it doesn't shows the anchor tag.

But the problem is I am not able to link to the anchor I have created. When I write [#here], it displays the text as is with "#" symbol.

Go ahead and paste the Wiki markup for your page here. We can probably explain it better that way.

0 votes
Joe Clark Atlassian Team Sep 15, 2011

Firstly, as Kevin says, you can't type anchor links like that directly into the Rich Text editor using wiki markup syntax - you should either swap to the wiki markup editor, or use the "link browser" dialog in the Rich Text editor to type in the link.

Secondly, I'm fairly certain you need to include the page title in the link, in addition to the name of the anchor, so try:

[PageTitle#anchorName]

To link to an anchor I followed following steps: -

1. In the rich text editor edit mode, pressed Ctrl+K to open link browser.

2. Typed the page name. As I started typing the page name confluence automatically lists the page names which inlucde that keywork which I am typing.

3. After entering page name I added anchor name like this - Home#Overview

4. Saved the page.

When I click on the link, it navigates me to the top of the Home page and not the Overview segment of the page. I check the wiki markup of the page for the link and it is as follows:

[Overview|MySpace:Home]

Above markup is in the form: -

[<Link text>|<space name>:<Page title>]

It doesn't include the anchor name, even when I specified the anchor name at the time of specifying the link in the link browser. When I modify the above markup in the "wiki markup" view as below it works fine.

[Overview|MySpace:Home#Overview]

So, it seems to me that there is some bug in Confluence. When we give anchor name from link browser it doesn't include it in the markup, but when I explicitly mention the anchor name in the "wiki markup" view, it works absolutely fine.

I think this is beyond the scope of the rich text editor in Confluence versions < 4.0. It is most reliably done in Wiki markup.

Is it the problem with ver. < 4.0? How about ver. 4.0 or greater?

Everything related to such problems changes in 4.0 and such problems are excluded by design. It is a whole new editor.

I tried to repeat steps from Atlassian Achors tutorial, but confluence could not find my anchors (strange). This video helped me to make links to anchors work.

Briefly:

  • create an anchor with name "anchorname"
  • show "Insert link" popup -> Advanced tag -> in Link field enter "#anchorname" (without quotes). Save link, save draft.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

1,099 views 17 14
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you