List all the titles of child pages

List all the titles of child 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 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&gt; 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

  1. Create a Report Table macro.

  2. Within the Report Table macro, create a Content Reporter macro.

  3. Within the Content Reporter macro, create a Text Filter macro with the following parameters:

    • Key: page:children, because we want the Content Reporter macro to only search pages with children. We can set it to all pages, but this may be resource-intensive.

    • Required: selected

  4. Within the Report Table macro, under the Content Reporter macro, create a Report Column macro with Title set to Parent Page.

  5. Within the Parent Page Report Column macro, create a Report Info macro with the following parameters:

    • Key: page:title

    • Link to Item: selected

  6. Under the Parent Page Report Column, create another Report Column macro with Title set to Children.

  7. Within the Children Report Column macro, create a Report Info macro with Key set to page:children>collect "title".