Hi! How to sort the page in the documentTree macro?

#1

I have several page , like this:
image,
the page name is date.They are queue from small to large, but I want them queue from large to small. How to Implement it ?
Thanks very much!

0 Likes

#2

There’s no parameter to control the order (ascending vs. descending). Your only option is probably to created a custom tree view https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/CreatingATreeView/ .

0 Likes

#3

Thanks! I will try .

0 Likes

#4

https://extensions.xwiki.org/xwiki/bin/view/Extension/Sorted%20Document%20Tree%20Plugin

can this plugin solve this problem?

0 Likes

#5

No. This is old code, written long before the current {{documentTree}} macro existed.

0 Likes

#6

Where is the sorting order in the document tree hard-coded, can we make an adaption there?

It sorts a little bit strange:
A. My first area
|__ 1.2. my third page
|__ 1.1. my second page
|__ 1. my first page

0 Likes

#7

Try “1.0 my first page”. The page names are sorted as strings not numbers.

0 Likes