[xwiki-users] How to customize sibling pages panel?
Hi, I wish to customize the sibling pages panel in order to get a static root generic navigation panel usable in my migrated spaces (I used the nested pages migration tool, I migrated from Xwiki 7.0.1 to 8.2). I already had a navigation panel but it worked with spaces and now Xwiki says it is deprecated. How can I customize the sibling pages panel to do that? If I change the documentTree root parameter into velocity script (root="document:xwiki:foo.WebHome") to point to the first page of the "space", if I log in with another user that it is not "Admin" username I get "No pages found". I'd like to change the documentTree root to point always to the page root of the migrated "space", if it is possible avoiding writing the absolute name but using a variable (or a method) to get the root of nested pages and it should be visible by every allowed user. I read the XWiki Velocity Training, it should be also good inserting a paragraph for things like that, l think it could be very helpful. Thank you for reply Regards Matteo -- View this message in context: http://xwiki.475771.n2.nabble.com/How-to-customize-sibling-pages-panel-tp7600500.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How to customize sibling pages panel?
No one has this needs? I think it will be a common problem for users that are migrating from older versions to new ones... Thank you Matteo -- View this message in context: http://xwiki.475771.n2.nabble.com/How-to-customize-sibling-pages-panel-tp7600500p7600528.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] How to get top level page node in documentTree?
Hi, I modified the Navigation panel menu in order to have a structured tree menu that always shows FOO page root and the opened path to reach the current node (FOO project has nested pages). {{velocity}} #panelheader("FOO MENU") ## Escape special characters in macro parameter values. #set ($openTo = $services.model.serialize($doc.documentReference, 'default').replaceAll('([~"])', '~$1')) {{documentTree showTranslations="false" showAttachments="false" compact="true" showRoot="true" openTo="document:$openTo" root="document:xwiki:FOO.WebHome" /}} #panelfooter() {{/velocity}} Considering all my projects are inside Main\projects page, is there a way to find dinamically the toplevel page node without having to specify the root page name (FOO.WebHome)? Thanks for reply -Matteo -- View this message in context: http://xwiki.475771.n2.nabble.com/How-to-get-top-level-page-node-in-documentTree-tp7602158.html Sent from the XWiki- Users mailing list archive at Nabble.com.
Re: [xwiki-users] How to get top level page node in documentTree?
As you suggested I created a copy of the navigation panel to work on. My xwiki pages are structured as follows: https://url/xwiki/bin/view/Projects/FOO/ https://url/xwiki/bin/view/Projects/FOO2/ [...] Inside "Projects" there are several "main" pages for each project (FOO is an example of the main page of a project). FOO page has a tree structure as you correctly wrote: FOO.A.WebHome FOO.A.B.WebHome FOO.X.Y.Z.WebHome I thought there were be something similar to manage the new pages logic (an easier way to navigate nested pages). Your suggestion about creating a new document reference using document reference works well, I "played" with substrings: #set ($index = $openTo.indexOf('xwiki:') +6) #set ($index2 = $openTo.indexOf('.',16)) #set ($subb = $openTo.substring($index,$index2)) #set ($resultpage= $subb.concat('.WebHome')) Is there a better way to gain this result? Thank you again, -Matteo -- View this message in context: http://xwiki.475771.n2.nabble.com/How-to-get-top-level-page-node-in-documentTree-tp7602158p7602176.html Sent from the XWiki- Users mailing list archive at Nabble.com.