I've got this piece of code to count pages with a certain label in a certain space
## To count labels
## @param Label:title=Label|type=string|required=true|desc=Enter a label to count.
## @param Spaces:title=Space|type=string|required=false|desc=This Key is case-sensitive. Only for use in one single space. Example: SPACEKEY
#set( $labelManager = $action.LabelManager )
#set( $labRef = $labelManager.getLabel($paramLabel) )
#set( $pages = $labelManager.getCurrentContentForLabelAndSpace($labRef, $paramSpaces) )
$pages.size()
I would really like to filter on, multiple labels (in AND and OR) anyone knows how?
Any help is appreciated
Thank you.
Hi @[deleted]
I know the answer for the "AND", but not for the "OR"
#set( $list = $labelManager.getContentInSpaceForAllLabels(0, 10, $paramSpaces, $labRef, $labRef2))
See documentation.
With this statement, you get a list of all pages in the space with the labels from $labRef AND $labRef2. Because it's this type of parameter (Label... labels) you can add as much labels you want.
The only thing I can imagine for "OR" would be to search with CQL, but this is a bit tricky (Don't know how)
Regards, Dominic
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.