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

Creating navigation links for parent/child pages

I'm currently trying to reorganise a number of pages into a usable documentation that can be easily navigated by adding a set a links to the end of each page that contains "prev home/up next" which will link to the appropriate page in each case.

i.e. if I have the following set of pages

  • Overview
    • Sub Topic 1
      • Child page 1
      • Child page 2
      • Child page 3
    • Sub Topic 2
      • Child page 1
      • Child page 2
      • Child page 3

When viewing child page 2, I would like to create links at the bottom of the page to point to "child page 1 Sub topic 1/Overview child page 3"

Rather than hardcode these and then have re-edit them each time I move pages around or add in new pages, I was hoping that someone could suggest how to use the {report-xxx} macros correctly to achieve this? I think it's a lack of understanding how the 'prefix:key' works is what is catching me out in most cases.

What I'm looking to add to each page is something similar to what can be seen on the following page with confluence updating the links automatically as new pages are added:

2 answers

1 accepted

0 votes
Answer accepted

Would the Navigation Plugin work for you?

Very close, if it could retrieve child pages using the key page:sorted children it would do what I want, unfortunately it sorts by alphanumeric. Think I'll have to change how I'm naming the pages to get this idea to work. Shame as it would have been very useful to be able to reorganise documentation by simply changing the order of the pages without needing to edit each page.

Just to be sure, I'll start by saying perhaps what you consider hardcoded is actually soft coded. When you move pages around, the name of the page in a [ ] link will still find the page.

You may be saying you have some hierarchy (family) of pages which is dynamic, but you want a to present links to each node in the hierarchy. Assuming Overview remains the root of the tree, you can use some simple solutions:




If you really want to use the reporting plug-in, I am not sure how to get a hierarchically organized tree from it. Here is the basic list of all descendants:


{content-reporter:space=@self|types=+page|scope=SVN > descendents}




An alternative for you is to create the page tree map manually on another table of contents page and then {include} that page on each of your family pages. That would actually free you from having to worry about having the pages organized in a certain way.

True hardcode may not have the right meaning, but it's the difference between identifying the page to which the link should always point too and having confluence dynamically determine what it should point to based on where it lies relative to other pages.

I'm already using the {children:depth=1} on the sub-topic pages, and that works pretty well for vertical lists.

What I'm looking to add to each page is something similar to what can be seen on the following page:

Where if new pages are inserted between "child page 2" and "child page 3" the wiki macros produced links that are correctly updated to point the next link on "child page 2" and the prev link on "child page 3" to the new page in sequence.

To do what I'm looking at, on "child page 2" in my layout above I need some why to pick out the sibling pages currently organised before and after the current page, but use of {report-xxx} appear to order the results differently to the manual order you can impose on child pages.

The output from the following 2 snippets does not result in the same ordering, even though they have the same content:


{content-reporter:space=@self|types=+page|scope=@self > children}

If it's not possible, I can add in links using the standard format and update them as changes are made, it would just be nice to have it work without needing any maintainence.

If you are able to alphabetically name your pages in the child 1, 2, 3 order, you can add a {text-sort} to the content reporter output. Let me know if you need an example of that syntax.

Another possible option for you is to organize the ordered set of children pages as a linear tree organization where each next child is the only child of the current child. Then your prev and next hyperlinks can be driven by the reporter macros giving parent and child. Up/Home can be fixed links. Use {link-to:@parent}Prev{link-to}.

Suggest an answer

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

2019: All Wrap(ped) Up Like a Present

Hindsight might be 2020 but looking back, a lot of cool new features rolled out in 2019. From new collaboration and organizational powers to fresh templates and handy integrations, it’s been quite th...

245 views 0 7
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