Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Showing labels from other pages in overview

Simon Lund Larsen June 16, 2020

I'm very new to Confluence and NOT a programmer, so please excuse the typos and misunderstandings below :)

I'm building an overview page in Confluence (server) and would like to have the labels of the pages I link to in the overview shown.

I've tried to write a macro that does this, but I can't wrap my head around it and getting it to work.

## @param page:title=Page|type=confluence-content|required=true|desc=Select page you want to show the labels from

#set($currentPage = $pageManager.getPage($content.getId())
#set($pageLabels = $currentPage.getLabels())
<span>
#foreach( $labelObject in $pageLabels )
<span class="aui-label">
<a href="$labelObject.urlPath">$labelObject.name</a>
</span>
#end
</span>

I assume the problem is that the page I select and put into "page" is not the one being called in the following part with "getLabels()"

But how do I get the labels from the page I select?

1 answer

0 votes
bilal_hussain June 16, 2020

So you are looking to create a page overview, where you find the link of pages created in confluence under that branch. If Yes then . 

 

For the page/document you want to create,  you need to add a label to e-g "Release" for your all release plans. 

 

Go to overview , edit the over view page , create a box , where you provide a heading of the page as Release plans , and then click insert + sign add content label and add the same label in there also.. you will find your documents listed in Over view page too... 

Simon Lund Larsen June 16, 2020

No, I've already created the overview page with a long list of pages (some child pages, some parent pages, etc.).

What I want to just insert a simple macro, that asks for what page I want to show the labels of (this could be any page)

Simon Lund Larsen June 16, 2020

CleanShot 2020-06-16 at 13.37.02.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events