How to auto-expand sidebar page tree to show children of current page?

Frank Boisvert October 24, 2018

Server version 6.10.1

In the sidebar, i'd like my users to click a parent page, not expand it, but click it, then when the page loads, it has expanded the child pages to show what's included. 

In the Space Tools sidebar box, i've got {pagetree:startDepth=2}, but {pagetree:startDepth=2|root=@self} doesn't work, like it does for the Page Tree macro. It errors off, saying "The root page @self could not be found in space WD NMCI." 

I've tried some others from the page tree macro, but it never works. https://confluence.atlassian.com/doc/page-tree-macro-163414255.html

root=@parent returns "Error formatting macro: pagetree: java.lang.NullPointerException"

Obviously the sidebar isn't the same as the macro...



2 answers

1 accepted

2 votes
Answer accepted
Frank Boisvert October 24, 2018

Oh. I'm dumb. Apparently the functionality i'm looking for is enabled by default...... if you aren't using startDepth.

I've had startDepth enabled this whole time. Never thought to not use it. Would be nice is we could use startDepth and have this functionality work also.

So we're just going to remove startDepth, move the pages we want up one level and call it a day.

0 votes
Wilhelm Klauditz January 12, 2021

Hi, I have a similar problem. I use the page tree macro in the sidebar. I added the macro by using wiki markup in the sidebar section (within the space configuration) like this:

 

{pagetree:root=WKI Home|sort=position|excerpt=false|reverse=false|expandCollapseAll=false|startDepth=1|searchBox=false}

 

I would like my users to see (only!) the child pages of the current page. How can I achieve this? I followed Frank's suggestion and removed the startDepth parameter but nothing changed. Still, the child pages of the current page are not showed.

Wilhelm Klauditz January 12, 2021

Additional information: We use server version 7.4.1

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events