List the links to all space templates using Reporting and Linking
Scenario
It can be a tedious task to view all space templates from all spaces in a Confluence instance. The following recipe generates a report listing the links to all space templates for quick and immediate access.
Result
Recipe
Apps | Linking for Confluence, Reporting for Confluence Data Center |
|---|---|
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> </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
Create a Report Table macro to format the report as a table.
Within the Report Table macro, create a Space Reporter macro with Spaces:
@llto retrieve all spaces in Confluence.Under the Space Reporter macro, create a Report Column macro with Title:
Space.Within the Space Report Column macro, create a Report Info macro with Key:
space:name.Under the Space Report Column macro, create another Report Column with the following parameters:
Title:
Links to Space TemplateInjected: selected, to allow injection of a supplier
Within the Links to Space Template Report Column, create a Link to Location macro (from the Linking app) with the following parameters:
Location:
space templatesLink Text:
LinkSpace:
%space:key%
The enclosing percentage (%) sign indicates an injected value, meaning that it will retrieve the supplier value within to inject into the macro parameter before the macro is rendered.