colap Posted January 1, 2011 Share Posted January 1, 2011 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? Quote Link to comment Share on other sites More sharing options...
BLaZuRE Posted January 1, 2011 Share Posted January 1, 2011 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. Quote Link to comment Share on other sites More sharing options...
johnny86 Posted January 1, 2011 Share Posted January 1, 2011 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.