Looking to customize the renderChildren() macro used near the bottom of each page

Hi,

I need to slightly modify the renderChildren() macro that is being used in the default page layout: I need to display all pages, but with their children recursively.

The end effect being something around the output of this wiki markup:

{pagetree:root=@self|excerpt=true|expandCollapseAll=true}

Showing page excerpts and collapse|expand links is not really that critical. The most important aspect for me would be to include children's children in the output.

One of the considerations is that I want this customization made at the space leve. I don't want to mess around the site-wide configuration. Currently I've edited my space page layout and commented out the #renderChildren() invocation alltogether. The negative side of this approach is that now I need to edit every page and manually add the above snippet in order to have recursive children of the current page.

So I wondered if there was any other way to automatically get this effect for all pages of my space - may be the #renderChildren() macro accepts configuration arguments? Unfortunately I'm not conversant with the internal macro syntax, nor did I have any luck googling around regarding this toppic :(

1 answer

1 accepted

You could render the pagetree macro in the layout with $helper.renderConfluenceMacro():

##renderChildren()
<div id="children-section" class="pageSection children-showing group">
    <div class="section-header" style="padding-left: 0px;">
        <h2 id="children-section-title" class="section-title">Child Pages</h2>
    </div>
    $helper.renderConfluenceMacro("{pagetree:root=@self|excerpt=true|expandCollapseAll=true}")
</div>

Hope this helps

Thanks Remo! Worked like a charm. I wasn't familiar with the helper interface.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Friday in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

280 views 11 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you