It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

Graham Hannington May 08, 2018

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?

1 comment

Fabienne Gerhard May 08, 2018

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.

Fabienne Gerhard May 08, 2018

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)

Graham Hannington May 08, 2018 • edited

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.

Fabienne Gerhard May 08, 2018

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 ;)

Comment

Log in or Sign up to comment
Community showcase
Published in Confluence

6 Awesome Ways to Apply Trello, JIRA and Confluence to your Project

I attended  Atlassian Summit 2019  and learned a lot from the presenters, attendees and knowledgeable Atlassian product managers. The presentations I attended focused on applying Agile, pla...

909 views 6 17
Read article

Community Events

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

Events near you