Display a list of child pages for a page with customized details
Scenario
If the Children Display macro is too basic, and you require much more finesse in what sort of data is displayed along with the children pages, then Reporting allows listing of child pages complete with customized details.
This recipe lets you list the child pages together with their modified dates as well as the person who modified the pages.
ProTip
If you want to display only the child pages of the child pages, refer to Display a list of only grandchildren pages.
Result
Recipe
Apps | Reporting for Confluence Data Center |
|---|---|
Level | Intermediate |
Estimated time | 30 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:
<p class="auto-cursor-target">
<br />
</p>
<ac:structured-macro ac:macro-id="e6eae86f-0bca-4e25-891d-e803e558a6b8" ac:name="report-list" ac:schema-version="1">
<ac:parameter ac:name="depth">all</ac:parameter>
<ac:rich-text-body>
<p class="auto-cursor-target">
<br />
</p>
<ac:structured-macro ac:macro-id="b975ccfc-fc7c-417e-9d5f-a307aad12fad" ac:name="local-reporter" ac:schema-version="1">
<ac:parameter ac:name="">content:children</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="6b9aed75-f091-4a94-8f9a-24334923fb1b" 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>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br />
</p>
<ac:structured-macro ac:macro-id="cee9e713-797f-42fb-876e-e63b2bcfc5e4" ac:name="report-body" ac:schema-version="1">
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="42f77846-0594-47ba-8840-0c5b59c1f39d" 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> (<ac:structured-macro ac:macro-id="f3eeee99-9e49-48ea-b65b-f0b34550dc0a" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="format">dd MMM, yyyy</ac:parameter>
<ac:parameter ac:name="">content:modification date</ac:parameter>
</ac:structured-macro> by <ac:structured-macro ac:macro-id="fb318dd8-d3f1-426a-a522-6b194727707a" 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>
<p class="auto-cursor-target">
<br />
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br />
</p>
Macro structure
You can recreate the example in the editor view:
Steps
Line | Description |
|---|---|
1 | The report will be formatted as a list with the Report List macro, which displays each of the items from a reporter as a list item. The parameter Depth is set to |
2 | The Local Reporter macro gets the child pages of the current page, by setting supplier key to content supplier. |
3 | The Date Sort macro sorts the child pages returned from the Local Reporter macro from latest to oldest, by setting supplier key to content supplier, and setting order to |
4 | The Report Body macro serves as a container for displaying reported values. |
5 | The title of the individual child content returned from the Local Reporter macro is displayed using a Report Info macro, by setting supplier key to content supplier. Setting link to |
6 | The date the child page is last modified is displayed using a Report Info macro, by setting supplier key to content supplier. The format is set to |
7 | The user who last modified the page is displayed using a Report Info macro, by setting supplier key to content supplier. The name is made a link to the user's homepage, by setting field link to |