Universal CSS Navigation Menu Support Product Page

I would like to use UCNM with a categories database table.

Asked 27 Jul 2012 10:51:03
1
has this question
27 Jul 2012 10:51:03 Greta Garberini posted:
I would like to use UCNM with a categories database table. The structure is straight forward:

ID parentID Name
1 0 MainMenu1
2 0 MainMenu2
3 0 MainMenu3
4 2 SubMenu1 of MainMenu2
5 2 Submenu2 of Mainmenu2
----------------------------------
x y zzzzzzzzzzzzzzzzzzzzz


I hope the example shows what I like to do. The second level of submenus uses the id of the main menu as its parent. Main Menu items always have 0 as parentID

Replies

Replied 27 Jul 2012 11:26:34
27 Jul 2012 11:26:34 Vulcho Vulev replied:
Hello Reinhard.

Please take a look at the following video tutorials which will guide you through the dynamic usage of the menu :

Creating Dynamic Mega Menu from an Existing Database Table
Creating Dynamic Menu from Recordset

Regards:Vulcho.
Replied 28 Jul 2012 04:57:34
28 Jul 2012 04:57:34 Greta Garberini replied:
Hi Vulcho,
thank you for your quick reply. The first sample shows a very uncommon structure. If your table has three columns and you put columns like Fruit, Vegetables and Fish for categories and in the same table the products: this would mean you have duplicate category entries for each new product.:

id category product
1 Fruits Apples
2 Fruits Oranges
3 Fruits Bananas
...
6 Vegetables Tomatos
7 Vegetables Cucumbers
...
Lets say you have a typo. If you have several products and would need to change the category entry for each product, this would become a nightmare.
Better would be the structure I showed in the mail above: working with parent - child relationships. In that case you only need to correct one entry in case of a mistake.
So, should'nt there be some nested mysql query?
Maybe this is covered in the second sample and the structure was not shown; maybe I have overlooked it.

Reply to this topic