...

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



qin2
06-14-2005, 10:44 AM
Hello

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 = [
['Home','http://www.your-site.com/'],

['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?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum