Zoe -- Sorry, I just now saw your reply! You can use $this->Category-
>reorder(); just like that to reorder the entire tree from top to
bottom... very handy!
On Nov 9, 10:19 am, MonkeyGirl wrote:
> OK, so using $this->Category->reorder(); reorders all the children of
> a given category (in this
OK, so using $this->Category->reorder(); reorders all the children of
a given category (in this example), and their children, and so on, but
is there any way to reorder _all_ the categories, including the top
level ones?
I see now the point about my code not doing anything more than the
original
One more note, MonkeyGirl, and I'm sure we're already on the same
page, but the syntax should be $this->ModelName->reorder(); Using the
categories example from http://book.cakephp.org/view/228/Basic-Usage
, the syntax to reorder the entire tree by name is $this->Category-
>reorder();
On Nov 2, 9
Also note that one issue with your reorderAll() function is that it
loops through all non-empty parent IDs. The only problem with this is
that top-level items WILL have an empty parent.
On Nov 3, 10:27 am, Kerr wrote:
> To be more specific in addressing, "I'm also still not
> sure if reorder() r
To be more specific in addressing, "I'm also still not
sure if reorder() recurses as far as it can, or just one level. " --
Yes, it will recurse the tree until it finds no children in all
affected branches.
On Nov 2, 8:25 pm, Kerr wrote:
> Hi, I've been playing around with thetreefunctionality
Hi, I've been playing around with the tree functionality as well.
Looking at the code, you'll notice that the reorder method calls
itself recursively. If you want to reorder the entire tree, simply
pass no arguments... e.g.
$this->reorder();
Overall, I'm pretty impressed so far with how easy