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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,459,440
Community Members
 
Community Events
176
Community Groups

Inserting a link to an anchor on another page creates a "create page" link instead

Edited

I have a Confluence (Server, 6.7.0) page with the title "5 Information security policies". (Yes, with a "hardcoded" heading number... possibly too much information: this heading is a "control" from ISO/IEC 27001:2013 Annex A.)

The page contains the heading "5.1.2 Review of the policies for information security". (If Confluence supported search'n'replace across pages out of the box, I would consider chunking the page so that this "5.1.2" heading was its own page, and the problem I'm having would evaporate. But that's another discussion.)

I've inserted an Anchor macro, with the anchor name "5.1.2", at the start of that "5.1.2 ..." heading.

Here's what I did to create a link to that anchor (that heading) from another page in the same space:

  1. Edit the page (where I want to insert the link).
  2. Select the text that I want as the link text.
  3. Click Insert link.
  4. Click Advanced.
  5. Begin typing the page name in the Link box. An "autocomplete" entry appears under the Link box with the page name and anchor I want, "5 Information security policies#5.1.2".
  6. Click that autocomplete entry. This fills in the Link box.
  7. Click Insert. The link text appears highlighted, but with a different appearance from page links: the link is underlined, even when I'm not hovering over it.
  8. Save the page.

When I view the saved page and inspect the resulting link, here's the URL (I've replaced some strings with "..."):

http:// ... /pages/createpage.action?spaceKey= ... &title=5+Information+security+policies&linkCreation=true&fromPageId=...

Clicking the link creates a new page, which is not what I want.

How do I create a link to the anchor? What am I doing wrong?

Is there is an issue with the periods in the anchor?

2 comments

Hi @Graham Hannington

 

did you try to remove the anchor and link directly to the heading? 

I'm not sure what you mean by autocomplete - but when you open

Insert link -> Advanced

you should just fill in 

5 Information security policies#5.1.2 (page name#anchor name)

in the first box. 

Second box would be link text you marked!

Awesome security information (Text shown on site)

I made the experience when a page doesn't exist or the user doesn't have access rights the createpage action is made instead of viewpage -> a hint for that would be the underline and changed color for that. (and maybe '5 Information security policies' is a page that doesn't exist?)

I would first try to set a link directly to the page -> in Edit mode press [ than start typing 5 Inform... -> if it doesn't autofill, page name is not correct. 

Try to add the link like written on top.

What just came to my mind right after my reply - is the page you create the link in the same space? Maybe you have to put the spacekey also in

XXX:5 Information security policies#5.1.2 (spacekey:page name#anchor name)

Thanks for the suggestions.

I'm embarrassed to admit that it was user error: my problem.

Yes, I selected "5 Information security policies#5.1.2" from the autocomplete entry that my browser (Chrome) displayed under the Link input text box, but a page with that title no longer existed. I'd forgotten that I'd appended a string in parentheses to the end of that page title: so the actual current page title was "5 Information security policies (...)#5.1.2" (I've used "..." instead of the actual string, which I don't want to show here).

I can't blame Confluence for that autocomplete entry; that's browser behavior, not Confluence.

You were right:

maybe '5 Information security policies' is a page that doesn't exist

Thanks again!

Apologies to all for my misleading "report".

P.S. I was initially nervous when the working URL showed the page title in the hash: 

http:// ... /pages/viewpage.action?pageId=50332014#id-5Informationsecuritypolicies(...)-5.1.2

but I needn't have worried. When I edited the destination page, and changed its title, and then refreshed the page containing the link (in another browser tab), Confluence had updated the hash to reflect the edited page title. Phew.

Good to hear,  - no worries that's what the community is all about :) helping and sharing experiences we made.

As you can imagine from what I've written - I've made similar experiences like you when setting anchors ;)

The full answer is in the anchor documentation. There are different syntaxes according to whether the anchor is on the same page, same space or different space.

Like Chris Choi likes this

Comment

Log in or Sign up to comment
TAGS

Atlassian Community Events