Listing Links to All Space Templates

Scenario

Viewing all space templates in every space on a Confluence instance can be a tedious task. The following recipe generates a report listing the links to all space templates for quick and immediate access.

Result

 

Recipe

Apps

 

Linking for Confluence Server, Reporting for Confluence

 

Apps

 

Linking for Confluence Server, Reporting for Confluence

 

Platform

Server

Level

Easy

Estimated time

10 minutes

Macros

Report Column, Report Info, Report Table, Space Reporter

Suppliers

Space Supplier

Storage format

You can copy and paste this code into the Confluence Source Editor:

<ac:structured-macro ac:macro-id="9aadf0c6-7fe4-4fea-a1b6-f15e727a4430" ac:name="report-table" ac:schema-version="1"> <ac:rich-text-body> <ac:structured-macro ac:macro-id="6dbd5edb-1e01-44c6-90fc-3ce2d79a48bc" ac:name="space-reporter" ac:schema-version="1"> <ac:parameter ac:name="space"> <ri:space ri:space-key="@all" /> </ac:parameter> <ac:rich-text-body> <p>&#xa0;</p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="f3c08354-99b5-43cc-ab0c-9120270104cf" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="title">Space</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="5680bc0a-5f79-472e-8036-0d21f8ca0edb" ac:name="report-info" ac:schema-version="1"> <ac:parameter ac:name="">space:name</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="21c1ffad-0744-4bb0-9f18-2b0d9e36df65" ac:name="report-column" ac:schema-version="1"> <ac:parameter ac:name="injected">true</ac:parameter> <ac:parameter ac:name="title">Links to Space Templates</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="e821fb06-8edf-412d-974e-21121836088e" ac:name="link-to" ac:schema-version="1"> <ac:parameter ac:name="linkText">Link</ac:parameter> <ac:parameter ac:name="space"> <ri:space ri:space-key="%space:key%" /> </ac:parameter> <ac:parameter ac:name="">space templates</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. The report will be formatted as a table with a Report Table.

  2. Space Reporter retrieves all spaces in Confluence, with the ‘spaces' parameter set to '@all.’

  3. Two columns ‘e created u.’

  4. The link to each space template page is created with Link to Location. The location parameter is set to ‘space templates.’ The link Text parameter is set to ‘Link.’ To indicate the space of the link it's referring to, the ‘space' parameter is set to '%space:key%.’ The enclosing '%' sign indicates injected value, meaning it will retrieve the supplier value within to inject into the macro parameter before the macro is rendered.

 

Line-by-Line Explanation

n/a