I found this answer (https://answers.atlassian.com/questions/3898), but it is now 3 years old and much has changed in Confluence in that time.
I have the immediate need to display a list of pages under a specific parent (not a space, but a parent page with numerous children) that contain a specific label. I have created user macros before, but I've nothing too fancy and nothing that uses an existing macro in which I try to expand its functionality.
Has anyone created a macro like this that you could share? Or can someone provide details on how to do what is talked about in the linked question above?
Community moderators have prevented the ability to post new answers.
Hi Mark,
Here's something I whipped up, you could probably call it "descendants-with-label" or something like that:
## @param Label:title=Label|type=string|required=true|desc=Pages that contain this label should be displayed <ul> #foreach ( $descendant in $content.getDescendents() ) #foreach ( $label in $descendant.getLabels() ) #if ($label == $paramLabel) <li>#contentLink2($descendant, false, false)</li> #end #end #end </ul>
Just make sure you choose which label you want in the macro options and you should be good to go.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.