Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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

Add link to navigate to parent page

Is there a (easy) way to add a link to the current parent page that will continue to work after pages are rearranged in the hierarchy? I'm not sure we will be able to install a plugin. If we do install a plugin, it has to be rock solid.

Example: (Read ~ as whitespace)

A (parent of B)
+-- B (parent of CD)
~~~+-- C (Child of B)
~~~+-- D (Child of B)

B has a link that navigates to A

CD have links that navigate to B

Then change happens, and the tree is re-organized to look like this:

A (parent of D)
+-- D (parent of BC)
~~~+-- B (Child of D)
~~~+-- C (Child of D)

Now, without having to edit the pages...

BC's link navigate to D

D's link navigates to A

5 answers

1 accepted

0 votes
Answer accepted

Hello Brian,

You can use the Documentation theme to embed a page three macro on the left hand side of each page.

This will give you a full page tree rendered on each of the pages of a space. It will include links to all descendants from the root of the space much in the matter you outline above.

Please let us know if that works for you.

I had forgotten about the docuemntation theme. While the space I'm using has the documentation theme on, it is too cluttered making it awkward to navigate. I may end up moving my pages to a new space since they are designed as a documentation collection.


Pushing this idea a bit furhter I created the following feature request.

Supporting links to @<locations> may be a way to get the functionality you are looking for without the extra bulk of the documentation theme. If you think it is a good idea please give it a vote up in the upper right hand corner.

I was using the solution provided by Richard for a while, but unfortunately the page information tools hasn't been updated for the newest version of Confluence (not to mention that Confluence tries to update any wiki markup whenever it gets a chance).

After searching a bit, I finally found that you can make a simple user macro that will provide the same functionality.

## @noparams
#contentLink2($content.getParent() false false)

Add a user macro, choose a name and title (I used linktoparent and "Link to Parent") and leave the rest of the options at the default values. Copy and paste these two lines into the macro body field and save, and it should work.

This works really well but is only 99% complete. I've updated this with the following code instead: ## @noparams #if (!$content.getParent()) <b>No parent page found</b> #else #contentLink2($content.getParent() false false) #end

Like # people like this

@David Grierson thanks a lot, you've just saved an hour of research for a single person, thousand hours for thousands of seekers!

Like Tomáš Vrabec likes this

@David Grierson. I concur, thank you for this. Exactly what I was looking for. 

Here is our solution. I will always display the name of the parent page and make it clickable. It will dynamically change no matter where you move the page to updating the parent link appropriately.

You'll need these macros:

  1. Click Edit on the page you wish to add the link
  2. Click Insert -> Wiki Markup
  3. Insert some dummy wiki tags like {bogus}{bogus}
  4. Click Insert
  5. In the Wiki Markup panel remove the bogus tags
  6. Insert the following wiki markup


If it can be useful:

## @param Title:title=Title|type=string|required=true|default=Go Back
## @param Style:title=Style|type=enum|required=true|enumValues=Primary,Standard|default=Primary

#if($paramStyle == "Primary")

#if (!$content.getParent())
<b>No parent page found</b>
<a class="aui-button aui-button-compact $btnClass"
style="position: absolute"
<span class="aui-icon aui-icon-small aui-icon-small aui-iconfont-chevron-left-circle"></span>
<span style="$txtColor">$paramTitle</span>



Have a nice day,
-- Vincent

The Reporting plugin would be one option here. It brings an "awareness" to the situation, so for instance, you could define a link on the current page which points at the parent page. This is not hard coded though, so if the page moves, then the link will point to the new parent.

{report-link:content:parent &gt; content:url|default=_This page has no parent._}View parent page{report-link}

More info here:

I can recommend this plugin. It is a commercial one, but the license cost is reasonable in my view.

An alternative approach could be to write a user macro, as I think the Confluence objects available in Velocity (user macro language) will allow you to identify the parent of the current page, and so create suitable links.

Charles--thanks for the pointer. I like the capability of the reporting plugin. I wish we had it!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence Cloud

🏠 Say hello to the new Confluence Home!

Hi Atlassian Community, My name is DJ Chung, and I’m a Product Manager on the Confluence Cloud team. Today, I’m excited to share a new and improved version of Home. The new Home helps you ...

5,878 views 11 55
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