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

how to SIMPLY create a link to anchor to my confluence site from external site

hi, I have read all the posts how to create links to anchor (https://confluence.atlassian.com/doc/links-776656293.html) I have learned, what is the syntax, from that page. OK. But I am looking for a simple way to grab the link to my page that is in this syntax.

That is to say, I do not want to manually write the link according to this guide: http://myconfluence.com/display/spacekey/Page+name#pagename-anchorname

I am looking for a place, that I can copy the link, that includes spacekey, pagename... to my site. then I will only add the cross and anchor name and I can copy the link to my external site and it will work.

my problem is, that manually puzzling this link together takes a lot of time and several tries: i have to find the space key, that I have to play with two versions of the pagename and only then I can add the anchor name.

The ideal way would be that the Anchor macro could contain the link in the UI that I could only copy to my clipboard.

linking to an anchor is very complicated for me 

 

thanks for hints, maybe I am missing something obvious

2 answers

1 accepted

0 votes
Answer accepted
Zak Laughton Atlassian Team Aug 03, 2018

Hi Richee,

The easiest way to get the link for an anchor on a page is to create Confluence link to the anchor, then copy the link URL.

Here are the steps I'd take on a page that has an anchor titled "myanchor":

  1. Click Edit.
  2. Type [#myanchor]
    The open bracket should start the link creation, and the close bracket will create the link.
  3. Save the page.
  4. On the newly created link, right-click > Copy link URL

Now you can paste the correctly formatted URL wherever you'd like, without manually trying to create the URL.

I hope this helps!
-Zak

Thank you Zak, this works perfect.

Why this trick is not available on the standard help page? It is not possible to construct the link manually for pages with complex names. what a shame

https://confluence.atlassian.com/confcloud/insert-links-and-anchors-724764900.html

This sounds easy enough, but

here is a link I got from copying an anchor

https://cadenhance.atlassian.net/wiki/spaces/PD/pages/596574211/Part+Addition+Guide

so the page name is "Part Addition Guide"

But where does the 596574211 come from?

When might that number change?

Will it change if I make a change to the page?

Will it change if I delete the page and add the same named page back?

In other words, if I hardcode this link into a help link one of my tools, how will I know when I need to update that link?

hi, now we have a Copy link next to each header in confluence pages. 

Look like this:

 

image.png

Like Oscar Ferrari likes this

 

Thanks, but that doesn't answer my question completely

https://cadenhance.atlassian.net/wiki/spaces/PD/pages/596574211/Part+Addition+Guide

I was able to get the link, I want to know where the number 596574211 came from

in that link, and when it might change.

 

I provide a tool to my customers and am trying to add buttons to take them to appropriate documentation for certain features... If I edit the page and the link changes, then my approach is doomed to failure :)

and I don't see that copy link...

I am using confluence cloud, would that change anything?

Hi. Sorry, I found that Copy link tool is a part of macro set installed to our confluence. it is this: https://docs.stiltsoft.com/display/public/HMFC/How+to+use+Handy+Heading

The number in your link example is the ID of the confluence page. It never changes, whatever is the name of the page. This is my experience. On the other hand, when you set the page to edit mode, there is a number higher by one. check it. but published page number never changes, I believe.

However, if you refer the a header on the page (using anchor or whatever), you cannot change the name of the header, obviously. it has no ID.

Richee,

Thanks for the detailed answer!
Unfortunately the Handy Macros are not compatible with Confluence Cloud!

The only "external" links I can seem to find always have the Page ID in them and I have not been able to figure out how to get a link to just a header, or even to an explicit anchor I added on a page.

In past I found this:

The easiest way to get the link for an anchor on a page is to create Confluence link to the anchor, then copy the link URL.

Here are the steps I'd take on a page that has an anchor titled "myanchor":

  1. Click Edit.
  2. create anchor with name "myanchor"
  3. Type [#myanchor]
  4. The open bracket should start the link creation, and the close bracket will create the link.
  5. Save the page.
  6. On the newly created link, right-click > Copy link URL

Now you can paste the correctly formatted URL wherever you'd like, without manually trying to create the URL.

Thats essentially what I've done...

One nice thing to do is to add a TOC on your page and then the Header links will be available to copy from there

I wish the Handy tools were available for confluence cloud!

Just throwing out another potential solution to this annoying problem.

https://github.com/grantwinney/generate-links-for-headers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

Lessons and Learnings: Six Months of Working Remote [Discussion]

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...

7,071 views 6 6
Join discussion

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