Jump to content

Which is the best way to make dropdown navigation menu?


colap

Recommended Posts

Using unordered list, <ul>

Reading from XML file,

Taking menu name from database,

 

Is there other system to make dropdown navigation menu?

Which is the best way to make dropdown navigation menu?

I also want to show the sitemap of navigation.How can it be done?

Link to comment
Share on other sites

Depends.  If you're going to have a static list or one that doesn't change much, I'd suggest making a static unordered list (using CSS) with HTML.  I don't know why you would load XML.

 

If your links change for some reason (though I don't really see this), you can load from a database.

Link to comment
Share on other sites

There are numerous ways to achieve what you want. But I prefer to use unordered list. If you want your menus to be more dynamic I would suggest that you use database to fetch your menu items using the adjacency list model for storing your menu trees (Since menus arent usually that deep, they are wide horizontally). How that model works; you store the parent id for every item and for root items parent is empty.

 

Unordered list is also great because you can easily do dropdown menu using only CSS. All you need is the menu tree from database and then you can spit out <ul id="nav"> and that's it. Now you only need to print <li><a href="#">Item</a></li>. That's basicly all there is to it with UL.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.