and so on. Now I want to hide all pages below “page aa”. Because the count of pages exceeds the count of listed pages and it’s not necessary to confuse people with the pages.
Is there a solution to hide all pages from navigation and not to exclude them from search index? So it’s a clean navigation tree only with the necessary pages?
I had seen that. But is it a good idea to change the default pages of the wiki due to updates?
And “excludes” need a list of excluded Pages. I want to exclude all subpages of a page. That’s seems not so simple. Only to first select all subpages and then exclude them from the tree.
Create your own panel (by copying the default Nav panel for ex), and configure the panel list to use your panel.
From what I see in the doc examples, you can specify a whole wiki or a document. I’m pretty sure that you could specify a space too, using space:Space1.Space2...SpaceN. I’ve never tried it though.
I changed the own Navigationtree with following code:
## Exclude all pages below tag "hideSubpages"
#set($hiddenSubpages = $services.query.xwql("from doc.object(XWiki.TagClass) as tag where 'hideSubpages' 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))
#end
#end
#end
And it works, but I have pages with a “,” in the Name. The following line of the original code:
I think you’re referring to page references. You can try to use the escape character (\), but I hope that the document tree macro supports that (not sure). If it doesn’t work, then I’d say it’s a bug and you could report an issue in Loading...