Applying empty a href links to menu items with sub-menus.

A

Anonymous

Guest
I would have thought that parentid has nothing to do with this menu item having no child menu items. All it means is that this is a root menu item.
Would it be better to read in all the menu items, then go through them all and flag each menu item that is referred to (via a parentid). Then any menu item that has a flag should not have a link.
One thing about the way your doing it is that it looks as though you assume that the menu items are in the correct order from the database, you might want to think about creating a sort of menu tree structure from this data to allow you to build up the menus prior to outputing them.
 
Back
Top