The macro retrieves all Confluence spaces and iterates through each to gather all labels associated with content in those spaces. It then compiles the labels into a single list and renders them in alphabetical order as clickable links. Each label link leads to a filtered search page displaying content tagged with that label.
#set($spacesParam = $parameters.spaces)
#set($allLabels = [])
## If a specific space key(s) are provided, split and prepare a list
#if($spacesParam)
#set($spaceKeys = $spacesParam.split(","))
#else
## Retrieve all spaces if no specific space keys are provided
#set($spacesResponse = $ConfluenceManager.get("/wiki/api/v2/spaces"))
#set($spaceKeys = [])
#foreach($space in $spacesResponse.results)
#set($discard = $spaceKeys.add($space.key))
#end
#end
## Iterate over each space key to get labels
#foreach($spaceKey in $spaceKeys)
#set($labelsResponse = $ConfluenceManager.get("/wiki/rest/api/space/$spaceKey/label"))
## Collect all labels from the space
#foreach($label in $labelsResponse.results)
#set($discard = $allLabels.add($label.name)) ## Add only the label name
#end
#end
## Sort and render the labels
<ul>
<p style="border-bottom: solid 1px var(--ds-text, #292a2e); width: 15%;">
<img src="https://dummyimage.com/70x50/f7f7f7/000000&text=A-Z" alt="A-Z icon">
</p>
#foreach($label in $sortTool.sort($allLabels))
<li style="list-style-type: none; margin: 5px;">
<a href="$baseUrl/dosearchsite.action?cql=label=${label}" target="_blank">$label</a>
</li>
#end
</ul>Display a list of clickable labels for a specified page tree
Dynamically list all child pages of the current page in a table format
Display a list of Confluence pages with a CSV download feature
List all Confluence spaces with details such as space name, author, and creation date
Display space details such as type, status, creation date, and links to permissions and calendars
Parse a table containing cost and currency columns, convert each row's value into a selected target currency, and append a footer row showing the total amount. Useful for tracking multi-currency expenses and reporting totals in a unified currency.
Display a list of guest users in a specific Confluence space
Displays a list of pages in a specific space with a specified title or label
Retrieve and display labels from a specified space
Create dropdown menus in Confluence Cloud with predefined option sets, multiselect support, and permission-based access controls