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?