|
Description: |
I tried to exclude some pages in the Navigation and created my own Panel. Added the Following code to the default Navigation Panel: {code:java} ## Exclude all pages below tag "hiddenSubpages" #set($hiddenSubpages = $services.query.xwql("from doc.object(XWiki.TagClass) as tag where 'hiddenSubpages' member of tag.tags").execute()) #foreach($hiddenSubpage in $hiddenSubpages) #set ($hiddenSubpageWildCard = $hiddenSubpage.replaceAll(".WebHome$", ".%")) #set($children = $services.query.xwql("where doc.fullName like :name").bindValue("name", $hiddenSubpageWildCard).execute()) #foreach($child in $children) #if($child != $hiddenSubpage) #set ($discard = $exclusions.add("document:" + $child.replaceAll(",", "\\,"))) ) #end #end #end {code} I tested it with the replace of "\\\\.", "\," "%2C" and without replace. In all versions of the macro, Pages with a comma are not filtered. |
|