|
|
 Dennis - 2007-03-05 18:32:09
I would like to be able to reorder the nodes from the Root level. I tried to change the class to achieve this, but somehow I can't get it to work.
My guess is that the function _optimize_orders() should do the job, but all root elements return empty after the array_pop($PositionS) function.
I hope there is a solution to this problem. Further I really like this class, it works perfectly!
With kind regards
 S.Shaban - 2007-03-05 22:30:17 - In reply to message 1 from Dennis
Hi Dennis,
I didn't get what you mean by re-ordering "from" the roots... the class support order inside the "node level" .. and not outside it.
But i think you maybe talking about a problem in ordering the roots itself, before you were getting stuck orders,luckly this was solved in the last change to the class source, just download the new file.
Best Regards,
Shadi
 Dennis - 2007-03-06 07:01:57 - In reply to message 2 from S.Shaban
Hi Shadi,
Thanks for your quick reply again. If you would like to use this class for a navigation structure, it might be handy to be able to re-order the nodes on te root level.
This is not possible at this moment, and I am trying to find a solution for this. All root elements have a order '0' and it can not te changed.
Anyway, I will keep trying and if I found a solution I will let you know.
With kind regards,
Dennis
 S.Shaban - 2007-03-06 09:46:27 - In reply to message 3 from Dennis
Ahh yes, just download the new class file and apply the same function ->order_node on the roots and it will work :) ..
 Dennis - 2007-03-06 11:31:24 - In reply to message 4 from S.Shaban
I tried to do it again (downloading the latest version and testing the class), but I still think it doesn't work correct. Here is an example of a list with only root elements:
Without re-ordering:
Home [ id='1', position='1>', ord='0' ]
Contact [ id='2', position='2>', ord='0' ]
About us [ id='3', position='3>', ord='0' ]
Services [ id='4', position='4>', ord='0' ]
Products [ id='5', position='5>', ord='0' ]
This will output a list with the above order. Say, for example, I would like to move the contact page 1 position lower, this is what the result is:
Home [ id='1', position='1>', ord='0' ]
Contact [ id='2', position='2>', ord='1' ]
About us [ id='3', position='3>', ord='0' ]
Services [ id='4', position='4>', ord='0' ]
Products [ id='5', position='5>', ord='0' ]
You see this will only change the order of the contact node, and with a query ( ...sort by ord ASC ) the contact node will end op at the bottom of the menu structure.
After this I would like to move the products page 1 position up, this is the result:
Home [ id='1', position='1>', ord='0' ]
Contact [ id='2', position='2>', ord='1' ]
About us [ id='3', position='3>', ord='0' ]
Services [ id='4', position='4>', ord='0' ]
Products [ id='5', position='5>', ord='5' ]
The order from products is now 5. Which is not correct. A last example: Let's move the services one position down returns this result:
Home [ id='1', position='1>', ord='0' ]
Contact [ id='2', position='2>', ord='0' ]
About us [ id='3', position='3>', ord='0' ]
Services [ id='4', position='4>', ord='1' ]
Products [ id='5', position='5>', ord='5' ]
The order of contact is changed to zero again and the order of services is changed to one ( 1 ). So I think it still doesn't work correctly, even with the latest changes.
I will also trie to find a solution for this, maybe the _optimize_orders() function should also change, because when you add a ROOT node, _optimize_orders() will do nothing..
With kind regards
|