Displaying a List of Children 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 children pages complete with customized details.
This recipe enables you to list the children pages together with their modified dates as well as the person who modified the pages.
ProTip
If you'd like to display only the children of the children pages, check out the Displaying a List of Only Grandchildren Pages page.
Â
Result
Â
Â
Recipe
Apps | Reporting for Confluence Server & 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 Report List, which displays each of the items from a reporter as a list item. Parameter depth is set to 'all' to list descendants with different depth levels. |
2 | Local Reporter is used get the children of the current page, setting supplier key to 'Content Supplier'. |
3 | Date Sort is used to sort the children returned from the Local Reporter from latest to oldest, by setting supplier key to 'Content Supplier', and setting order to 'descending'. |
4 | Report Body is used as a container for displaying reported values. |
5 | The title of the individual child content returned from Local Reporter is displayed via Report Info, by setting supplier key to 'Content Supplier'. Setting link to 'true' will make the item a link to the page. |
6 | The date the child page is last modified is displayed via Report Info, by setting supplier key to 'Content Supplier'. Format is set to 'format=dd MMM, yyyy'. |
7 | The user who last modified the page is displayed via Report Info, by setting supplier key to 'Content Supplier'. The name is made a link to the user's homepage, by setting field link to 'true'. |
Â
Line-by-Line Explanation
N/A