I have created an anchor on a page as follows
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.
Am I missing something?
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.
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.
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:
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:
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.
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 just wasted hours trying to do this. I added the anchor macro to the bottom of a page and gave it the name Bookmark.
I navigated to another page in a different space and inserted a link using the advanced option. I entered IHopeThisWorks as the link text followed by spacekey:pagename#Bookmark (obiviously using the actual space key and page name and it did not work.
Is there an issue when using special characters in a page name?
I don't think there is an issue with special characters in this regard only. Just tried the following: Inserting an HTML link via code editor as <a name="anchorname">xxx</a> and it won't work , too. The tags are deleted while being parsed, creating a blank output of "xxxx" I checked the code, there are no tags anymore an dlinking doesn't work. This means it wouldn't be possible to set alink to an achor from outside the system at all. *sad*
Never use capitals or special chracters in identifier's or variable's names.
I just discovered the following workaround:
Link to a heading on a page
Choose Link > Advanced then enter the heading in one of the formats below. Heading text is case sensitive and must be entered without spaces.
For a heading on this page:
Sorry for crossposting my own comments. Found a solution to link from outside. It's a little bit crude: Confluence uses the following syntax when it comes to anchor linking: http://domain.com/display/SPACESHORTCUT/pagename#pagename-anchorname
I've also spent hours (if not days) trying to get linking to Confluence page anchors from external pages (including in some cases, ironically, Jira tickets) and the above info finally solved most cases for me.
However, I've figured out some nuances that are worth adding here to save others' time:
Using the basic structure above:
1) Page titles with punctuation (specifically brackets "(" & ")" but may include others:
The punctuation marks are
- removed from the pagename in the URL path (left of the #)
- retained in the pagename in the URL fragment (right of the #)
For a page title "This & That" with anchor "001", the link would be
2) Page titles that start with a number:
The pagename in the URL fragment seems to get prefixed with "id-"
e.g For a page title "1 Guide" with anchor "001", the link would be
Hey there, folks! For most of us, the past six months- yes, you read that right- have been a journey. More people than ever before have pivoted to working remotely, and navigating being on-scre...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events