Collins, Michael D wrote:
Hi
We recently changed our configuration so that mySQL was used to house our data. Prior to this change treeview was showing all spaces and pages in alphabetical order. Now, the pages are still shown in alphabetical order, but the spaces are not. In fact their order seems to change! I believe I have the most up to date treeview code, though I am now beginning to think that the previous sorting was co-incidental. Is there code for a sorted treeview? Or is it a case of configuring something now we are using mySQL. I confess this is not an area of my expertise! We are using the latest version of XWiki, downloaded last week.
You should edit XWiki/Treeview (in wiki mode) and locate the line: #foreach ($space in $xwiki.spaces) and replace it with: #foreach ($space in $util.sort($xwiki.spaces))
Further to this, we also used to have the simple foreach($subdoc...code on each landing page per space so that all pages within that space were listed at the top. Again, this used to be in alphabetical order. It no longer is after this migration. I have managed to get around that by using a query (as per documentation), and this has put things back to how they were.
Either that, or you could again use $util.sort to sort the search results. -- Sergiu Dumitriu http://purl.org/net/sergiu/