Duncan McGreggor
-
2002-02-21
- priority: 5 --> 2
This needs 2 things:
1) A menu querying/building/displaying methodology, and
2) A programmatical means of accomplishing 1).
I think that an economical way of doing this will be
by using the id of the main menu, the parent id of the
sub menu(s), and the order in which these need to be
displayed.
Maybe something like this:
The default:
SELECT * from menu WHERE parent_id = NULL/0 ORDER BY
order
Sub menus:
SELECT * from menu WHERE parent_id = $cgi->param
('level') ORDER BY order
print everything from the first SELECT up until
menu_id = $cgi->param('level'), and then print the sub-
menu.
This is just for 2 levels deep, though - I want to
extend this to "infinite" sub-menuing.