-
☆ A M B ☆
- 179 Posts
Quote from: OpenGeek at Jul 15, 2011, 09:49 AM
Quote from: hwmaier at May 09, 2011, 06:29 PM
Also chaining the getResources calls is not an option for my application either as again the tvFilters parameter cannot be passed on to the second level getResources call.
Why can you not pass tvFilters to the second level call? It should be as easy as sharing a PropertySet across all your getResources calls with the same tvFilters value set.
I just found a way to sort a tree of resources with getResources:
&sortby=`{"parent":"ASC","menuindex":"ASC"}`
Works for 2 levels if the ids of the parent folders are growing.
More is here:
http://modxcms.com/forums/index.php/topic,66664.msg375810.html#msg375810
Oliver
-
☆ A M B ☆
- 179 Posts
Quote from: hwmaier at Jul 15, 2011, 07:30 PM
I would not say this solves this feature request in a generic way. Tree wise sorting using your method works only in the special case that the parent resource IDs are in growing order. Once you add resources to the tree at later stage, your method breaks.
Also it works only for the special case of 2 levels. What about more levels?
Well, this was not ment as a final solution for all tree sorts. It is a workaround which only works under certain circumstances. I wrote that and you repeated them. But if you need only 2 levels, you can make it work with my method. I thinks that’s better than not getting anythings in the tree to work.
But believe me, I would very much appreciate it if getResources would be able to walk the the whole tree with unlimited levels etc.
best
Oliver