Listing All the Titles of Children Pages
Scenario
This recipe shows you how you can use the Collect parameter from the Collection Supplier to return all children’s pages within a space.
Result
Recipe
Apps | Reporting for Confluence Server & Data Center |
---|---|
Level | Advanced |
Estimated time | 15 minutes |
Macros | Content Reporter, Report Column, Report Info, Report Table, Text Filter |
Suppliers | Â |
Storage format
You can copy and paste this code into the Confluence Source Editor:
<ac:structured-macro ac:macro-id="15c1ce30-f6f6-4df2-a63b-f5b6448d9be0" ac:name="report-table" ac:schema-version="1">
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="37f22894-0620-4a98-a07c-b240316df915" ac:name="content-reporter" ac:schema-version="1">
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="76fc07a3-bbc9-45e3-8748-109fd35d7ac4" ac:name="text-filter" ac:schema-version="1">
<ac:parameter ac:name="required">true</ac:parameter>
<ac:parameter ac:name="">page:children</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="a397a096-1f20-433b-941f-ebea679d5f3d" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">Parent Page</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="279c45fb-7cc4-43f9-a590-896da0e54c6a" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="link">true</ac:parameter>
<ac:parameter ac:name="">page:title</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="7ec0298d-5263-4db5-acb8-b1b297bada2f" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">Children</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="227bfd53-1fa9-4328-83e5-58cd5b6ca7e9" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="link">true</ac:parameter>
<ac:parameter ac:name="">page:children> collect "title"</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 Table macro.
Within the Report Table macro, create a Content Reporter macro.
Within the Content Reporter macro, create a Text Filter macro.
Set the Key parameter to page:children.
Check the Required parameter.We're setting up a Text Filter macro here because we want the Content Reporter to only search pages with children. Or else it would search for all pages which may be resource intensive.
Within the Report Table macro and under the Content Reporter macro, create a Report Column macro.
Set the Title parameter to Parent Page.Within the Report Column macro, create a Report Info macro.
Set the Key parameter to page:title.
Check the Link to Item parameter.Back within the Report Table macro, create another Report Column macro.
Set the Title parameter to Children.Within the Report Column macro, create a Report Info macro.
Set the Key parameter to page:children>collect "title".