Jump to content

Javascript/DHML drop down menu populated from database


lip9000

Recommended Posts

I've been searching now for months and have just given up. I've also tried to create my own menu using pre-made drop down menu software then using dreamweaver to try and get the values from a database but have had no success.

 

I've made a CMS which allows users to greate sub menu items, and then sub-sub menu items to those submenu items. And now the final thing to do is create the drop down menu on the front end of the site.

Is there a particular site or software package that anyone could point me to that is very good and allows you to create the menu's based on data in a database? So it will allow me to select which table contains the main buttons, which table contains the sub menu items, and also the sub-sub menu items.

 

I was told to come to the javascript forums and post this so I could get some help as to how to populate the javascript menu with the database values. I've tried using pluginlabs menus and opencube menu's and then replacing the menu items with repeat regions to go through and grab each item needed for the menu. This works but only for the submenu items, getting each submenu item to display their corresponding sub-sub menu item is extremely difficult!

 

MANY MANY thanks to anyone who can help me and put me out of this agony!!

Link to comment
Share on other sites

If I understand you correctly you want to create something like this:

 

<select name="submenu">
      <option> - item1</option>
      <option>   - item 1.1</option>
      <option>   - item 1.2</option>
      <option>   - item 1.3</option>
      <option>       - item 1.3.1</option>
      <option>       - item 1.3.2</option>
      <option> - item 2</option>
      <option>   - item 2.1</option>
</select>

Or you don't want a select?

 

Anyway what is important that your database saves your data as a way that it can be retrieved hierachialy.

That means that you can have a database table with the following columns

 

item_id  item_name item_parent_id

 

How you should save your data can be read here:

MySQL Hierarchical data

 

If this is what you are looking for (with the select thing), I'll tell you how you can retrieve this.

If this is not what you meant then maybe make an simple example of what you want to achieve?

 

Regards,

 

Alex

 

 

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.