For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > September 2007 > Re: Can I display 2 different DBNested Set/HTML_Menus on the same









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Can I display 2 different DBNested Set/HTML_Menus on the same
Daniel Khan

2007-09-27, 8:02 am

Hello,

Mark Reynolds wrote:
> I'm displaying 2 menus on the one page using DBNestedSet and HTML_Menu
>
> The first menu 'urhere' uses getAllNodes()
> but the second menu just uses getBranch()
>
> I can't put my finger on it, but once the getAllnodes urhere menu is
> displayed the data somehow carries over and populates the array of the
> getBranch tree menu with all nodes instead of just the sub branch. This is
> even though I go through the DBNested process again.
>
> It looks like I somehow need to reset the data once the first menu has been
> displayed.


[..]

getBranch() suggests that it returns the branch below the give node.
DB_NestedSet supports multiple independent trees and uses the term
'branch' for such a tree and so getBranch() returns the tree where the
given node is in.
So if you only have one tree (branch) this means that you will always
get the whole tree with getBranch().

I think what you want is getSubBranch().

Please let me know if this fixes your issue.

--
Daniel Khan
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com