Stand with Ukraine 🇺🇦

All Labels from Every Space in One List

Multi-Space Labels List - Generate an alphabetical list of labels from all spaces, linking each label to its corresponding con... - Preview 2
Multi-Space Labels List - Generate an alphabetical list of labels from all spaces, linking each label to its corresponding con... - Preview 3
adminconfluence-contentnavigation

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.

Try for free

Template

#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>

User Parameters

Spaces

Select a space or spaces to narrow search results

Chosen by Top Global Companies Across Diverse Industries

BNP Paribas
Census
CNES
EDP
HHMI
HP
Hyundai
Index
Intercars
Melia
BNP Paribas
Census
CNES
EDP
HHMI
HP
Hyundai
Index
Intercars
Melia
Ministry
NVIDIA
PayPay
Pfizer
Qualcomm
Rail Canada
Red Cross
SEC
Space Institute
Telefonica
Ministry
NVIDIA
PayPay
Pfizer
Qualcomm
Rail Canada
Red Cross
SEC
Space Institute
Telefonica

Got Questions?

Fill out the form, and we'll guide you through every step of the way