How can set the page properties report macro in a template to refer to current page programatically?

I want to create a template that includes a page properties report macro to show a list of child pages, limited to only show the current page's children.

I have upgraded to 5.8 so can take advantage of the "with Parent" field, but I can't see a way to set it in the template so that field is automatically set to the new page created by the template.

I guess I'm looking for @self or something similar so that I don't have to set that macro every time I create a page from the template.

6 answers

This widget could not be displayed.

I have looked at the page in the Source editor. After creation, the macro looks like this: <ac:structured-macro ac:macro-id="70bb97d7-6709-41ea-a6a4-e86ad0830c77" ac:name="detailssummary" ac:schema-version="2"> <ac:parameter ac:name="label">requirements</ac:parameter> <ac:parameter ac:name="cql">label = "requirements" and space = currentSpace() and parent = "2359318"</ac:parameter> </ac:structured-macro> The space filter is using a method currentSpace(). I have tried applying that logic to parent, using parent = currentPage() but that method doesn't exist. So is there an equivalent method for the current page?

This widget could not be displayed.

I'm also looking for this feature - seems it's missing currently.

This widget could not be displayed.

I also expected this update to page properties report macro to allow you to be able to limit reporting to the current page's children.

This widget could not be displayed.

Looking for this feature as well! Wonder how it could be missed ...

This widget could not be displayed.

Did anyone find a solution for this? Trying to do the same.

This widget could not be displayed.

I do not know how to to it with the Page Properties Report Macro, but you could use other add-ons to limit the result set to children.

For instance the (commercial) projectdoc Toolbox Add-on has the Display Table Macro which supports the parameter Restrict to immediate Children. Note that you need to use the Document Properties Marker Macro instead of the Page Properties Macro provided by Confluence.

The code for the macro in storage format looks like this:

    &lt;ac:parameter ac:name="doctype"&gt;asset&lt;/ac:parameter&gt;
    &lt;ac:parameter ac:name="render-no-hits-as-blank"&gt;true&lt;/ac:parameter&gt;
    &lt;ac:parameter ac:name="render-mode"&gt;definition&lt;/ac:parameter&gt;
    &lt;ac:parameter ac:name="select"&gt;Name, Short Description, Rating&lt;/ac:parameter&gt;
    &lt;ac:parameter ac:name="restrict-to-immediate-children"&gt;true&lt;/ac:parameter&gt;
    &lt;ac:parameter ac:name="sort-by"&gt;Sort Key, Name&lt;/ac:parameter&gt;

Biased Alert: I'm one of the authors of this add-on. smile

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

522 views 7 6
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