Page 1 of 1

Multilevel menus

Posted: Tue Jan 10, 2006 10:11 am
by kendall
feyd | This topics has been split from here.


Hey,

I was just reading this post cause i am building a similar menu system however i want to allow for multi-dimensional menus..

so far i used php to do recursive processes but i am reading into this "NESTED set model" approach....

Problem is...i don't understand what the heck you guys are saying...

I looked at the articles but im still confused about the left and right columns....

How did they arrive that the values?
how do you apply that formula when adding and updating records?

Ttimvw,

Im tryin to understand your concept but im a bit puzzled...how about a beginners start?

Kendall

Posted: Tue Jan 10, 2006 10:57 am
by timvw
Don't have an example right way... But i can tell you there is a pear package Nested_Sets that does this all for you...So you can simple use that implementation :)

Nested Set Model...building database hierarchical-data

Posted: Tue Jan 10, 2006 11:30 am
by kendall
timvw wrote:Don't have an example right way... But i can tell you there is a pear package Nested_Sets that does this all for you...So you can simple use that implementation :)
Just so you guys no...did a bit of googling and found t his article...its soooo much simpler to understand...

http://dev.mysql.com/tech-resources/art ... -data.html

Kendall

Nested Set Model...building database hierarchical-data

Posted: Tue Jan 10, 2006 1:22 pm
by kendall
Guys....quick discussion here....

if im building a menu system with several "root" level menus would it be wise to start each root with one and have a nother column like say a "group id" that will tie al related sub menus to the root?

thus

Code: Select all

MenuID | Name | lft | rght | group
1           | name 1  |1  |  6  |  1
2           | name 2  |1  |  4  |  2
3           | name 3|1|2|3
4           | sub 1 |2|3|1
5           | sub 2|4|5|1
6           | sub 3|2|3|2