Displaying a List of Only Grandchildren Pages

Scenario

The Children Display macro provided by Confluence allows you to display all children’s pages of a specified page. But it won't allow you to display ONLY the children of the children pages, (what we call "grandchildren" pages), without the parent pages.

This recipe shows you how to display ONLY the grandchildren pages, including some extra details such as when it was last edited and who last edited it.

(This feature is only available from Reporting 6.14.0 and onwards.)

Result

Recipe

Apps

Reporting for Confluence Server & Data Center

Apps

Reporting for Confluence Server & Data Center

Level

Intermediate

Estimated time

10 minutes

Macros

Date Sort, Local Reporter, Report Body, Report Info, Report List

Suppliers

Content Supplier

Storage format

You can copy and paste this code into the Confluence Source Editor:

<ac:structured-macro ac:macro-id="ab791995-f5fd-4186-8f48-a33df25a0807" ac:name="report-list" ac:schema-version="1"> <ac:parameter ac:name="depth">all</ac:parameter> <ac:parameter ac:name="style">disc</ac:parameter> <ac:rich-text-body> <ac:structured-macro ac:macro-id="57fae609-6523-4a7a-9d35-5fe8d3e54e67" ac:name="local-reporter" ac:schema-version="1"> <ac:parameter ac:name="source">CFSC:User Guide</ac:parameter> <ac:parameter ac:name="">content:grandchildren</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="c53854c5-53b1-4c11-b3c7-4c82b923fe9f" ac:name="date-sort" ac:schema-version="1"> <ac:parameter ac:name="order">descending</ac:parameter> <ac:parameter ac:name="">content:modification date</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="e7b364d0-d4ce-4a7a-8e26-62ee325c53c6" ac:name="report-body" ac:schema-version="1"> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="400a232f-dbd8-4383-be7e-aba540e43da2" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="link">true</ac:parameter> <ac:parameter ac:name="">content:title</ac:parameter> </ac:structured-macro> (Edited on <ac:structured-macro ac:macro-id="9e9f5e1a-56b6-489c-97e5-5eec938a0634" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="format">MMM d, yyyy</ac:parameter> <ac:parameter ac:name="">content:modification date</ac:parameter> </ac:structured-macro> by <ac:structured-macro ac:macro-id="406ef76e-29a5-421d-925f-414310cc94c9" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="link">true</ac:parameter> <ac:parameter ac:name="">content:modifier</ac:parameter> </ac:structured-macro>)</p> </ac:rich-text-body> </ac:structured-macro> </ac:rich-text-body> </ac:structured-macro>

Macro structure

You can recreate the example in the editor view:

Steps

  1. Create a Report List macro.
    Set the Depth parameter to "all".

  2. Within the Report List macro, create a Local Reporter macro.
    Set the Key to content:grandchildren.
    Set the Source parameter to the page you want to list the grandchildren pages.

  3. Within the Local Reporter macro, create a Date Sort macro.
    Set the Key to content:modification date.

  4. Back within the Report List macro, create a Report Body macro.

  5. Within the Report Body macro, create a Report Info macro. Set the Key to content:title and make sure the Link to Item parameter is checked.
    Immediately after that, type in "(Edited on ".
    And immediately after that, create another Report Info macro. Set the Key to content:modification date.
    And also immediately after that type "by".
    And then create another Report Info macro, this time setting the Key to content:modifier and making sure the Link to Item parameter is checked.