Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to make my links to anchors on the same page work

Stuart Gros-Dubois January 24, 2017

I have followed the instructions on the Anchors page. I am placing anchors at specific points in the article I am writing. Links at the top should link to the anchors in the article on the same page.

Now when I click a link, the URL is appended with #id-<PageName>-<AnchorName>
Otherwise nothing happens. No page reload reload, no scrolling to the anchor. 

I am using Chrome v.55

3 answers

1 vote
Stuart Gros-Dubois April 2, 2019

*2-years-later update*

At one point my company updated to a newer version of Confluence and this problem vanished. Sorry, I cannot remember when exactly nor which version the patch was introduced in. Best bet is to try with the latest available Confluence and browser versions.

@Bernd Schneider yours sounds like a different issue altogether. I was not experiencing this shortening behaviour.

Bernd Schneider April 2, 2019

Ok, thank you, Stuart!

0 votes
Rob Woodgate
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 24, 2017

Hi Stuart,

The page will only scroll if the anchor is off the bottom of the visible page.  That catches some people out, but I'm guessing from your description that you know that.

So, either the link is wrong, or the anchor is wrong.

Link:

When you add an anchor link, the format should be Space:Page#Anchor, and the link needs to be added in the Advanced > Link text box.

Is that exactly what you see when you edit the link?

Anchor:

When you edit the page is the anchor macro in the right place, and when you edit the anchor is the name of the anchor the same as the name of the link?

Stuart Gros-Dubois January 24, 2017

Thanks for your reply!

Yes the anchor to which the link should link is much farther down the page and not in the current view when I click on the link.

Link:

Although the link is on the same page as the anchor, I followed your instructions using the full "Space:Page#Anchor" but when I save the changes, then go back again to editing the link, I see that it has automatically removed the Space:Page components, leaving only #Anchor.

Yes to Advances > Link text box.

Anchor:

Yes to both, I have checked many many times

Rob Woodgate
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 25, 2017

Yup, Confluence removes the parts of the anchor link it doesn't need, but sometimes if the original anchor link wasn't correct then you get a problem, and that problem isn't obvious because part of the link has been removed!

Ok, if the link is right and the anchor is right, the next thing is to try it in another browser.  Do you get the same issue in both Firefox and Edge?

 

Edit: I've just seen your reply to Randy.  As anecdata, it's working on my (Cloud) version, so not a bug as such (although it might be a bug for your combination of Confluence and browser versions).

Bernd Schneider April 2, 2019

Hi,

a colleague of mine currently also has a problem that looks similar. Links are shortened (e.g. #GPS => #G), but not the anchor, so that afterwards the links points to nowhere. We couldn't find a rule, when exactly this happens. Also it is possible to correct the links, at least for a time.

Is there a solution to this two year old problem here?

Thanks & best regards,
Bernd

0 votes
Randy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 24, 2017

open the page source and search for id-<PageName>-<AnchorName> there might be some URL encoding or typo in your link that causes the issue.

Stuart Gros-Dubois January 24, 2017

Thanks for your answer. I did as you said, I am able to find my anchors <PageName>-<AnchorName> within the page source. It cannot be a typo because I noticed it is also doing it with the table of contents macro.
I noticed one of the previous pages that I created some years ago, that definitely had this anchoring/linking working, now does not work.
Maybe it is a bug in Confluence?

Like Murtaza Mansoor likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events