Accordion Menu / Posts /

Populate menu HTML markup dynamically with database data

29
Is there any documentation on using your drop-down accordion menu with a database to populate the menu dynamically?
Bernie  3 years ago   viewed: 11668    

3 Answers

-1

All instructions are on the page http://www.menucool.com/vertical/accordion-menu, and we have no other Users Manual or Documentation.

As there are so many different databases(SQL Server, MySQL, Oracle, ...) and server side languages(PHP, ASP.NET, JSP...), we are unable to provide detailed instructions on how to retrieve data from a database and to build menu HTML markup on the page by a server language. You have to be a developer of that database and that server language.

Milo   3 years ago
-2

Yes, I don't expect you to give me the detailed code itself in, say, ASP for MS SQL Server. But ...

a) Can your vertical drop-down accordion menu work when dynamically populated from a database? Can the number of 1st-level entries in the menu be arbitrary? And can the number of 2nd-level entries be arbitrary, and not necessarily equal, for each 1st-level entry? Or, in other words, does your menu have any implicit constraints on these things that I need to know about (and can't know in advance because there is no documentation)?

b) Would the structure of the (dynamically generated) html/css/javascript code that is needed on the webpage be the natural extension of what you have hardcoded in your example at http://www.menucool.com/vertical/accordion-menu ? Or would some non-obvious tricks be needed? I can write this code if it just needs to be the natural extension of what you have hardcoded in your example, but not otherwise.

Bernie
  3 years ago
-2
a) Yes the menu will work when your code behind has got the database data, built up the menu HTML, and rendered the HTML to your page. As long as the menu markup conforms to the Menucool accordion menu structure, it will run the same way as the static HTML page does. Nothing different here. But if you are retrieving the database data later and will populate the menu HTML after the page has already been rendered to the client, you need to call the amenu.init() as shown by the page http://www.menucool.com/vertical/acdn/create-menu-on-the-fly.html.

b) Yes you should follow the menu's structure that is just the nested UL-LI formats. You can have an unlimited level of nesting, and the number of all level entries is arbitrary. They are all nature and don't have to be equal. 
Milo   3 years ago

   

Your name*
Password
(Optional. Used to modify this post afterwords)
+ =  

Ask your Own Question

  • If your question is related to the topic of this post, you can post your question to this page by clicking the "Post a reply" button at left;

  • When you want to start a new page for your question: