Display a list of only grandchildren pages
Scenario
The Children Display macro provided by Confluence lets you display all child pages of a specified page. But it won't allow you to display only the child pages of the child 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 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
Create a Report List macro and set the Depth parameter to
all.Within the Report List macro, create a Local Reporter macro with the following parmeters:
Set the Key parameter to
content:grandchildren.Set the Source parameter to the page for which you want to list the grandchildren pages.
Within the Local Reporter macro, create a Date Sort macro and set the Key parameter to
content:modification date.Within the Report List macro, under the Local Reporter macro, create a Report Body macro.
Within the Report Body macro, create a Report Info macro with the following parameters:
Set the Key parameter to
content:title.Select the Link to Item checkbox.
Immediately after the Report Info macro, enter
(Edited onand create a second Report Info macro with the Key parameter set tocontent:modification date.Immediately after the second Report Info macro, enter
byand create a third Report Info macro with the following parameters:Set the Key parameter to
content:modifier.Select the Link to Item checkbox.
Immediately after the third Report Info macro, enter
).