View Full Version : Generating Tigra DHTML navigation menu items syntax from DB

06-14-2005, 09:44 AM

I have installed "Tigra" dynamic navigation menu, and now it will be necessary , that the menu structure can be generated dynamically from mysql.

The syntax (to be generated) required for DTML structure is like:

var MENU_ITEMS = [

['Level 0 Item 1', null, null,
['Level 1 Item 0', 'another.html'],
['Level 1 Item 1'],
['Level 1 Item 2'],
['Level 1 Item 3'],

The DB structure I use is Hierarchical data structure (http://www.sitepoint.com/article/hierarchical-data-database)

The problem is, how to generate this code correctly dynamically. I have tried many kinds of while-loops, but I just can't get close tags "]," placed correctly :(

I hope you understood what I am trying to do,
Is there anybody who have any ideas to solve this problem?