The following helped me when I was setting up something like this: $this->Category->recursive = 0; $this->set('category_tree', $this->Category->findAllThreaded(null, array('id','parent_id','name'),'parent_id, name'));
It'll give you a multidimensional array based on parent_id. You could also use something like this to find parent nodes of an article. HTH, Eric On 2/23/07, double07 <[EMAIL PROTECTED]> wrote: > > > Ok, this is doing my head in. Basically I'm trying to setup a simple > CMS. So the part I'm wrestling with here is the pages or what I've > called 'Nodes' > > Now my nodes basically have fairly simple fields; id, parent_id, > title, summary, body, node_type_id, link, members and publish. It's > all pretty much setup and ready to go except for the parent/ > navigation... > > My plan was that there would be a navigation menu that would be > dynamically generated from the nodes table by setting it up so that > each node can be a child of another page (or it could be at the top of > the 'tree' by being 0). When editing/adding a page, the idea would be > that the user could just select the parent from a drop down list > (which has indented menu options). Now, I can't for the life of me > work out how to go about this in cake (i.e. models, relationships > etc.). > > In hindsight it might have been easier to setup "sections" that could > be edited/added and then generate the menu from that, but in the past > I've found that setup can cause problems. > > Has anyone successfully setup anything similar to what I want? If so, > could you please give me some pointers. > > Thanks in advance, > > Brett. > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---