Storing Hierarchial Menus
Posted: Thu Jan 12, 2006 2:03 pm
Hey,
Im building a menu system and im thinking about using the preorder tree traversal algorithm
now usually i'd be using the adjacent model but it gets complicated when having complex depth submenus.
but im having a bit of a task working out the abilities of updating, modifying and adding menu items in relation to sorting records and moving submenus from 1 root menu to the other...
I have the following questions...
Im building a menu system and im thinking about using the preorder tree traversal algorithm
now usually i'd be using the adjacent model but it gets complicated when having complex depth submenus.
but im having a bit of a task working out the abilities of updating, modifying and adding menu items in relation to sorting records and moving submenus from 1 root menu to the other...
I have the following questions...
- Would it be a good idea to start each root menu at 1?
- if i were not to impliment the above idea. what about providing an actual "sort" field. wud this be easier in being able to sort menus and sort thier children using the nested model?
- im looking at using the nested model system. how easy it is to "move" items from parent to parent using this system. if i took the sort field approach im thinking i can do something php side to work it out.