Page tree macro modification

Shireen Gonzaga August 2, 2018

For the page tree macro, the root page is specified but only the child pages below it are displayed in the tree. 

Is there a way to modify the macro such that the root page is displayed (as level 1) in the tree? I'm not a programmer, so some tips on where to get a copy of the macro and modify it to show the root page would be super-helpful.

 

Thanks,

 Shireen

2 answers

0 votes
Robert Reiner _smartics_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 2, 2018

Here is some macro code that might help to get you started with your own Java macro: https://bitbucket.org/atlassian/confluence-advanced-macros-plugin/src/master/

Note that the source is quite old and probably not the code of the current macro.

A second option (on Confluence Server) are user macros: Did not try it by myself, but at https://community.atlassian.com/t5/Answers-Developer-Questions/Creating-a-Custom-Page-Tree-macro/qaq-p/469709 there is a user macro that might help to get you started?

Shireen Gonzaga August 2, 2018

Robert, I appreciate these tips. Thank you! 

cheers,

  Shireen

0 votes
Lauren Schroeder
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 2, 2018

Hi Shireen,

I'm not sure of an easy way to modify the macro to change what root page is displayed. 

If you're using the macro in a limited set of cases, a workaround could be to create a 'dummy' parent page within your page tree. You could create a parent page for your root page, and select it as your root page in the macro. This would then display your actual root page as the level 1 in your tree.

 

Best,

Lauren

Shireen Gonzaga August 2, 2018

Thank you, Lauren. That's what we're doing for now. I was hoping there was a more elegant solution. :)

 

cheers,

  Shireen

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events