December 3, 2021

Confluence: external link to anchor (pitfall)

This is something I have learned that I find really weird and annoying in Confluence.
How to link to an anchor in a Confluence page from another web page.

Link to an anchor from another (web) page

The syntax is like this - as explained in the Confluence documentation here

http://myconfluence.com/display/spacekey/pagename#pagename-anchorname

What really bothers me is the part highlighted in yellow:

Before the anchor part, Confluence requires the page name as prefix. Standard HTML would expect #anchorname simply.

Link to pages using the pageId would also work but it isn't useful since the pagename is required for the anchor.

Bad Consequences

This makes the anchor link not robust to a page renaming and a big pita. 

Moreover, it is really not easy to build anchor links manually. You have to copy the page name and remove the blanks in it. But the most annoying part is that you have to be aware of this strange behavior.

I can hardly understand the reason for such an implementation.

See also

Anchors | Confluence Data Center and Server 7.6 | Atlassian Documentation

Confluence: Best Practices for Handling draw.io diagrams

No comments:

Post a Comment