Anchors and updating a page

bid_msg_76 September 29, 2020

Hi,

I have a few anchors in my page and I link them at the same page a few times.

Unfortunately when I'm editing my page (not stuff concerning the anchors, just anything on the page) the anchor-links will also lead to the anchor in the previous version of the page.

Why is that and what can I do to get the anchors right?

Thanks

2 answers

0 votes
JDune November 4, 2020

I have the same issue. Everytime I edit the page, the anchors stop working and instead link to the previous version of the page. I'm on version 7.6.1.

I have a ton of links so its very inconvenient to go through all of them and link them, so luckily I found a workaround.

Use Chrome otherwise the code needs to be modified. Note that this will break any links to other pages, so if your page also contains those, you need to edit this code snippet. Use at your own risk, but bear in mind that you can revert to the previous page version if something goes horribly wrong.

1. Press Edit to open the Editor view.

2. Right-click the page and click Inspect. 

3. In the console enter the following code: 

$$("a.confluence-link").forEach((elm) => { elm.removeAttribute("data-linked-resource-type"); elm.removeAttribute("data-linked-resource-id"); elm.removeAttribute("data-linked-resource-version"); });

4. Click Save.

0 votes
Dominic Lagger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 29, 2020

Hi @bid_msg_76 

I have a few questions:

  • Which confluence server version do you use?
  • How do you set the anchors? 

Check this:

  1. What is the url of the page you want to link?
  2. What is the url of the anchor link? 
  3. Do they match? 

Regards, Dominic

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events