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?
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:
I had a need to add a link to a paragraph in the same page; to do so I have added a Table of Content that has generated all the links to all headings in the page. Then where I needed to add the link I have simply added the link as per ToC
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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: #MyHeading
.
https://confluence.atlassian.com/confcloud/insert-links-and-anchors-724764900.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But in order to answer your question: Never use special characters or capitals when naming variables or identifiers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
http://domain.com/display/SPACESHORTCUT/pagename#pagename-anchorname
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 #)
example
For a page title "This & That" with anchor "001", the link would be
http://domain.com/display/SPACESHORTCUT/This+That#This&That-001
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
http://domain.com/display/SPACESHORTCUT/1+Guide#id-1Guide-001
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jon Wilkinsthanks Jon! your examples helped me out a TON!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is it the problem with ver. < 4.0? How about ver. 4.0 or greater?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Everything related to such problems changes in 4.0 and such problems are excluded by design. It is a whole new editor.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Go ahead and paste the Wiki markup for your page here. We can probably explain it better that way.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.