i user tree behavior,,but i build it like this table >> all parent must be null field not the top parent only..i know that is wrong but i need it to build menus...i use helper for that..but the problem i need if the user click on Entertainment (parent) see all articles in music(child) and movies(child),,so i check if Entertainment is null find his children
|-------------|----------------- --------------|----------|- | Id | Parent_id | lft | rght | name | -------------------------------|------------|---------- |------- | 89 | NULL | 25 | 30 | Entertainment | | | | | | 90 | 89 | 26 | 27 | Music | | | | | | 91 | 89 | 28 | 29 | Movies On Dec 11, 9:20 am, Geoff Douglas <drdouglas...@gmail.com> wrote: > May we assume that you are employing the Tree > Behavior<http://book.cakephp.org/view/1341/Basic-Usage>in this Section model? > > If so, the parent_id would only be null for the top most parent... correct? > Generally, when you use a tree or this kind, you must look at it like a > collection? So the top most element describes the collection. So, you would > always assume is had children and that is always has a parent... then test > accordingly. > > If not, then you have some more obvious errors in the code you provided... > but before we get in to that... let's answer the Tree question. > > Let me know. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php