How should i create a menu?????????

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
jaswinder_rana
Forum Newbie
Posts: 3
Joined: Wed Jul 07, 2004 11:28 am

How should i create a menu?????????

Post by jaswinder_rana »

Hi,
if my menu is something like
Home
About Us
.....
Contact Us

then how should i create it.
1) should i make it a static page and just include it every where?
2) should i use files and then create it on the fly?
3) should i use database?

these links almost gonna be same for all the pages. its just i wanna design my own very small content management system to allow some body from inside to change the content whenever they want to.

and also if i use templates then how does there work?????????

thanx in advance[/b]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you could use all 3.. I'd go with 1 and 3 myself. Build/use a template system (1) for the look and feel, but no content. Use a database (3) for finding the site structure and fill in the content areas of the template.
penguinboy
Forum Contributor
Posts: 171
Joined: Thu Nov 07, 2002 11:25 am

Post by penguinboy »

I store my menu links in an external XML file and parse it with php5's simpleXML.
jaswinder_rana
Forum Newbie
Posts: 3
Joined: Wed Jul 07, 2004 11:28 am

Post by jaswinder_rana »

you could use all 3.. I'd go with 1 and 3 myself. Build/use a template system (1) for the look and feel, but no content. Use a database (3) for finding the site structure and fill in the content areas of the template.
_________________
--feyd
so You mean to say i have to use both of them???
But i fear about 2 and 3 is if for 3 for some reason there is some problem with file and for 3 if there is some problem with database then nothing would would work properly
User avatar
Buddha443556
Forum Regular
Posts: 873
Joined: Fri Mar 19, 2004 1:51 pm

Post by Buddha443556 »

so You mean to say i have to use both of them???
But i fear about 2 and 3 is if for 3 for some reason there is some problem with file and for 3 if there is some problem with database then nothing would would work properly
I though feyd was very clearly stating his own preference to use 1 and 3. You have to decide what works for you. Me? I use a lot of 1's but a lot of my sites are pretty much static -- that's not really my preference it just how it worked out.

If your worried about 2 and 3 maybe generate the menu only when you change it and use 1.
User avatar
xisle
Forum Contributor
Posts: 249
Joined: Wed Jun 25, 2003 1:53 pm

Post by xisle »

store the menu in a database for easy editing,
build the menu flat when a change is made...
or maybe not
Post Reply