Best way to create a multilevel menu

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Best way to create a multilevel menu

Post by klevis miho »

What is the best (or a good) way to create a multilevel menu?
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Best way to create a multilevel menu

Post by Jonah Bron »

What do you mean? Like, a Javascript drop-down menu with sub-menus?
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: Best way to create a multilevel menu

Post by klevis miho »

For example the menus are in a database table, have id's and parent id's.
I am not interested in how the menu will look.
Also what is the best way to check the active menu item?
Joshwaa
Forum Newbie
Posts: 1
Joined: Tue Apr 19, 2011 12:21 pm

Re: Best way to create a multilevel menu

Post by Joshwaa »

What exactly do you mean?
eivind
Forum Commoner
Posts: 28
Joined: Tue Apr 19, 2011 7:57 am

Re: Best way to create a multilevel menu

Post by eivind »

You're thinking "best way" as in cleanest code with least processing time? :)
User avatar
waytoecommerce
Forum Newbie
Posts: 16
Joined: Tue Apr 12, 2011 11:47 am

Re: Best way to create a multilevel menu

Post by waytoecommerce »

In our view css based menu will be good. If we are going to user jquery or js scripts it will create problem in loading and other problems. Css menu work in all the browser successfully.
User avatar
flying_circus
Forum Regular
Posts: 732
Joined: Wed Mar 05, 2008 10:23 pm
Location: Sunriver, OR

Re: Best way to create a multilevel menu

Post by flying_circus »

klevis miho wrote:For example the menus are in a database table, have id's and parent id's.
I am not interested in how the menu will look.
Also what is the best way to check the active menu item?
The way you describe is what I am most familiar with and have found it to work well. Years ago when I used oscommerce, they would pass a $_GET variable in the format of: 00_11_22_33.

This string was easily exploded into an array and could be used to build a breadcrumb as well as expanding/collapsing of menu levels, and current selection. The only downfall is that it's easy for a user to break.
dddmx3
Forum Newbie
Posts: 16
Joined: Mon Sep 20, 2010 9:05 pm

Re: Best way to create a multilevel menu

Post by dddmx3 »

You could simple HTML then spice it up with CSS?
Post Reply