I am unable to get Anchors to work on my pages. I have read and followed the directions here: https://confluence.atlassian.com/display/DOC/Working+with+Anchors
I am trying to anchor a heading on at page, however, the link only takes me back to the page, not to the anchor section.
It looks like your anchors are misbehaving due to a bug:
CONF-26433
The Table of Contents macro is creating an anchor target that's intercepting your desired anchor because of a formatting bug. If you add an anchor to an existing heading, it causes the TOC to create a second anchor inside of its list, which causes the page focus in your link to go to the TOC link instead of the actual anchor.
To get around this, just delete the current UserGroup anchor, and remake it at the end of the previous section as a new line above the heading. It should still link to the heading as expected.
If you copy your existing anchor macro and move it one line up, make sure you click-select the macro and change the format drop-down from Heading X to Paragraph, otherwise it will show up in your TOC macro as a blank line and continue to break anchor linking.
When you follow the link that should take you to the anchor, what does the URL look like? It should look similar to:
http://baserURL/display/spacekey/Page+Name#PageName-AnchorName
If you're not using the Anchor macro and are manually linking to the heading, replace AnchorName with HeadingName in the above example for the same effect. You can also inspect the heading element with Chrome's dev tools feature or Firebug and look at the heading's id tag for the PageName-HeadingName text. You can add it to the page's normal URL after adding a # at the end and it should link to the anchor.
Side note: If there isn't enough content below your anchor to fill a full page in your browser window, the anchor will place your page view at the end of the page instead of placing the anchor at the top of the window. Here's an example using the Related Topics anchor from our Confluence API docs (mileage may vary based on window size):
Confluence XML-RPC and SOAP APIs - Related Topics
I am following the instructions from https://confluence.atlassian.com/display/DOC/Working+with+Anchors:
To link to an anchor from within the same Confluence site:
Choose Advanced and enter the anchor name into the Link box, noting the following:
Use the following syntax:
Anchor location
Link syntax for anchor
Same page
#anchorname
#bottom
#important information
Different page
pagename#anchorname
My page#bottom
My page#important information
Page in another space
spacekey:pagename#anchorname
DOCS:My page#bottom
DOCS:My page#important information
I am following the syntax for an achor within the same space but on a different page. The result is that the link takes me to the top of the page, but not to the anchor. This is true regardless how much text is on my page below the anchor point.
I can link to the URL, but my understanding is that this link will break if my page is moved. This is why I want to use the Anchor method described above.
Here's the process I just used to get an anchor to work in a dev 4.3.2 instance. First, add the anchor macro on the line desired in the target page (my target page is called Test Anchor):
Next, add the anchor name:
It should then look like this:
Then, to insert a link on another page (I added it to a child page of Test Anchor), use the format of Page Name#Anchor Name and it should anchor properly to the target pages anchor location.:
If you're following this same process and it's still not working, try a second browser to make sure it's not a browser specific issue. I'm testing in Chrome and Firefox, but I'm happy to check others you may be using.
There are two places in the reponse with colons (":") but nothing after the colons. Is something supposed to be there?
Does this functionality work like the bookmark functionality does in Word? Specifically, where you create a bookmark next to a heading. You give the bookmark a specific name and then link to the bookmark and not the heading. This way, the heading name can change without breaking the link.
Bringing it to Confluence, is the "Anchor Name" something you create and then link to? Or are you just copying the URL by right-clicking on the heading link in the TOC of the page you want to link to?
If you are just copying and pasting an URL, what is the point of the Anchor macro? What does it do that a hyperlink doesn't? I thought the purpose of a macro (as a opposed to URL method) would be to make the links persist. If the Anchor macro doesn't do this, what does it do?
Sorry, I hosted the images on our docsite in my personal space, but didn't enable anonymous access to the images. >.<
Yes, it works similar to bookmarks in Word. You need to link to the anchor name in the macro as opposed to the id of the heading itself. Now that the pics are working, that will hopefully help clear that question up.
The benefits to using the macro is that if you rename the page, which would change the URL, Confluence will adjust your link to the target so that it matches. For instance, if I change my Test Anchor page to Anchor Test, the link on my other page that goes to the anchor will still work, adjusting automatically. If you use a static link, then you would need to edit your page and change TestAnchor#LoremIpsum to AnchorTest#LoremIpsum.
Sorry for the confusion with the images. They work now.
Hi Adam,
I am using Chrome and when I follow the steps you outline, I link to the page, but not to the anchor on the page. And yes, there is lots of text below the anchor.
Also, I thought that headings functioned like anchors, but I cannot link to those either.
This is all in the on demand product, if that helps.
ETA: After I add the link and save the page, when I edit the link, the anchor text is missing. For instance, I add pagename#anchorname but when I re-open the link, all I see is pagename.
I am using Firefox in the On-Demand version and the above solution is not working. It will link to the page but not the anchor.
Thank you for your help.
Has this been solved? I'm having the same problem. I've created an anchor at a point in a page, #anchorname, and in a seperate page I'm trying to link to that anchor, page name#anchorname, so when that link is clicked on the other page opens up and the anchor scrolls to view, or perhaps it just opens up at the anchor. What is happening is the page with the anchor opens but it never scrolls down.
Hi Charles,
Are you using the TOC macro on your page? That affects how the anchors are used.
I'm not using a TOC, I'm using the anchor macro from the Insert other macros menu.
Are you anchoring to the same page? A different page? To a heading?
Our problem was caused by the TOC macro. Ultimately, I decided to anchor to Headings or Pages rather than to anchor tags, as the latter required too much management (we'd need to keep a list of all anchors in use, for instance).
I'm trying to anchor to a different page. I can anchor to the page but I'd prefer to anchor to the relavent section.
I am having a simillar issue with links in Firefox. If I link to an anchor (or just to a heading name) on another page, the page opens and it jumps to the right spot, but then it immediately jumps up about a page to a random spot in the content. If I enter the same URL in the URL bar when I'm viewing the target page, it works fine...the extra jump only happens when I use the URL while a different page is displayed. This doesn't happen in Safari.
Hi. I am coming in late to this discussion and you all may have already received your answers, but I thought I would jot down my experience so the Atlassian folks are aware of what I just discovered (if they aren't already).
I was having the same problem as everyone else in this string. However, one one page, all internal links worked. On a different page, NONE of them worked--yet, they were all created in exactly the same way (the way Confluence instructs on their Working with Anchors page).
I endlessly compared the two pages to see what was different. The only thing that remained was the title of the page: one title had no punctuation. The other title had an apostrophe 's. When I removed the apostrophe, all internal links worked.
Clearly, this is buggy and not intuitive. Hopefully Confluence will fix this in later updates.
Hope this helps.
I have Page A with a TOC. I want to link to a specific heading within this page.
I created an anchor at the end of the section before the heading I want to link to.
I've added a link to Page B = Page Name#anchorname. The link opens to the top of Page A but will not open to the specified anchor.
I have followed all of the suggestions above and still can't get this to work.
I am also unable to get Anchors to work on my pages. I followed the suggestion "just delete the current UserGroup anchor, and remake it at the end of the previous section as a new line above the heading. It should still link to the heading as expected." That did not work. I have no special characters in my headings, I've followed their instructions, still the anchor jumps to the top of the page. Using Atlassian Confluence 6.3.2. Does anyone have a real fix yet?
No, but I'm having the same problem. Anchor tags work for some of my colleagues, but not me. We're using the same browser versions, too.
I have the same problem- is there a ticket open on this?
This problem seems to exist since and over years. I'm pretty new to Confluence but running into same problem:
* In the search field only the "otherpage" will be found, not the anchor itself. I also got some images as proposal but only 2 of like 50 images I have uploaded/used in my space.
Clicking on the link will heading me only to the top of the page but not the the position of "myanchor".
Funny part: On top of "linkedpage" the anchor "myanchor" (same page) works and jumps to the anchor position. It just doesnt work coming from other page.
So far, our best guess is that some browsers and versions treat anchor links as case-specific, and others do not. #top doesn't always work the same as #Top.
Page https://confluence.atlassian.com/display/DOC/Working+with+Anchors has been deleted.
I am facing the same issue and the anchor links jumps to the target page but not to the specific heading.
It's a bug: https://jira.atlassian.com/browse/CONFCLOUD-62589
It is a bug: https://jira.atlassian.com/browse/CONFCLOUD-62589
Please Comment and Vote for the issue if you are reading this - Thanks Matt for posting the link .
Is this still a bug??
I think it is still a bug. I have the anchor at a non-heading level on one page and when I try to link to it on another page using page name#anchor name for the link, the link goes to the right page but does not scroll down to where the anchor is. Help please? None of the above helped me. I do have a table on the page with an anchor and a list of children elements on the page that contains the link to the anchor.
I think I've found the solution, any way worked for me.
In the description of anchors documentation, is mention that you need to add to link "Page name" and #" anchor name"
A half-hour of tests and make my draw.io work with my table and anchors inside this table!
In link you need to put ("Page name"#" Page name"-"anchor name")
I hope this will solve your problem!
Not a bug still but wack a doodle setup... The anchor in the header issue is still an issue but the man decided not to fix it.
The link to the anchor has to include both the page name and the anchor name after the #. This ain't HTML.
Real world example:
atlassian.net/wiki/spaces/~817853876/pages/756809729/Lorem+ipsum#Loremipsum-test
Page name = Loremipsum
Anchor name = test
Yes it is!
Sure it's a bug.Confluence is creating the URL's as you showed above, but that doesn't say that it's jumping to them.
In some cases it's working as it should, in most cases it just ignores the anchor-click.
Still cannot get anchors to work in Confluence. Pretty much makes the wiki a useless tool in my opinion. This is HTML 101 people. Fix it!
It looks like you're new here. Sign in or register to get started.