Tree sorting

Author Message

Tobias Persson

Thursday 16 September 2004 5:58:58 am

Hi,

I have a javascript tree menu for navigation on my site. But I have a small problem. When I fetch the nodes for the menu, I would like to use the same sorting as the admin for all folders and subfolders. (like the sort_by, $node.sort_array, but here I would like $node to change so I get the correct sorting for all subnodes)

Something like this (if I had choosen alphabethic sorting)

I would like:

Anode
-- Asubnode
-- Bsubnode
-- RSubnode
Bnode
-- Asubnode2
-- Bsubnode2
-- Rsubnode2

Right now I think i get the result like this:

Anode
Asubnode
Asubnode2
Bnode
Bsubnode
Bsubnode2
RSubnode
Rsubnode2

Anyone understand what I mean? And maybe even have a solution :-) Thanks

 

Bård Farstad

Friday 17 September 2004 12:58:36 am

eZ publish cannot sort the subtree result within the tree structure. The sorting will discard the tree information. If you want to have it sorted you need to fetch one level at the time. Mabye you can use the treemenu() template operator, this will do that for you.

--bård

Documentation: http://ez.no/doc

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.