If someone can help me with this I would be very grateful… I have struggled with it for a long time…
I have built a cms (in php) where I gnerate a dyamic nav menu from the database from the elligible pages (e.g. pages that are not expired). I am having trouble building the menu structure correctly.
In the database (mySQL) I have a “page” table, that includes the fields:
pageid, parentId, menu_sort and menu_level, (and others) to allow me to sort the pages in the right order for the menu with correct indents, etc. (i.e. what level/depth in the menu a page appears). I do not need to do recursive work, since the pages are all sorted correctly, however, not all pages are elligible for display by all users (it depends on login permissions).
e.g:
Home
…Products
…About Us
Staff
…Directors
…Sales Team
Office
…Site Admin
…Editors
…Login
I cannot figure out how to ascertain (in my menu script logic) when we are in a new node whose parent is being displayed. E.g. if a parent page is not elligible for display, so should it’s children be not elligible for display, (despite their expiry setting). Using the above example, if “Staff” is not to be included, [COLOR=darkred]how can I jump to the next record, “Office” to evaluate it, instead of having to evaluate “Directors” and Sales Team"?[/COLOR]
This may seem easy to someone, but if you can help me get the script logic together I will be grateful!
Geoff