Page 1 of 1
how to create dynamic menu from database for cms
Posted: Wed Aug 04, 2010 5:49 am
by egyptcoders
welcome ,
i want to create dynamic menu that depends on database' tables that i will use it to create cms
i attached an image as an examlpe
can any one help me please
Re: how to create dynamic menu from database for cms
Posted: Wed Aug 04, 2010 5:52 am
by superdezign
Well, what kind of database structure are you dealing with? How is the parent-child relationship established? How far have you gotten?
Re: how to create dynamic menu from database for cms
Posted: Wed Aug 04, 2010 6:04 am
by egyptcoders
i deal with mysql database
this example i not created and also donnot know how it is created , so i asked here
very thanks for you
Re: how to create dynamic menu from database for cms
Posted: Wed Aug 04, 2010 6:24 am
by superdezign
To create a tree structure of similar elements, you'd just set up a parent-child relationship in the main table.
Code: Select all
`navigation_links` table
ID | Parent_ID | Name | URL
1 | 0 | Parent1 | #
2 | 0 | Parent2 | #
3 | 2 | Child1 | #
4 | 2 | Child2 | #
5 | 4 | Child3 | #
6 | 0 | Parent3 | #
Code: Select all
+ Parent1
- Parent2
+ Child1
- Child2
+ Child3
+ Parent3
Re: how to create dynamic menu from database for cms
Posted: Wed Aug 04, 2010 6:57 am
by egyptcoders
thanks , but there is no main table i use
these elements are created automaticaly from database tables , i will need to create a file that organize this structure from the database
so , each table ia an element that i cat set title and href for it , also i can add childs with title and href and so on
Re: how to create dynamic menu from database for cms
Posted: Wed Aug 04, 2010 7:04 am
by superdezign
So, you want us to tell you how to deal with a database table that is already created, yet you have no idea what it looks like and can provide no details as to how it's structured?