Forum Moderators: coopster

Message Too Old, No Replies

Navigation - Hardwired on DB driven?

         

neophyte

12:08 am on Oct 3, 2007 (gmt 0)

10+ Year Member



Hello All -

I've been chipping away at a development framework to use in all my projects for the past few months and I've come to the issue of navigation. I currently have framework options for a simple top nav, a top nav with drop-down menus, a side nav and footer nav (sitemap, privacy policy, et al)

When I constructed these elements, I just hard-wired a bunch of duplicated statements into seperate includes which I could easily add to or eliminate by manual pasting or cutting. Now I'm wondering how efficient that is going to be (in the long run) vs. putting all navigation attributes into their own table and letting PHP generate these navigation elements on the fly.

At first glance, going the DB route would be my preference - and I imagine major commercial and news sites do it this way - but if you have a complex (and/or lengthy) navigation scenario, are there display-time/performance issues to take into consideration due to the fact that I'd be looping through any number of rows to grab the same nav data during each page re-refresh?

Interested in all opinions.

Neophyte

jatar_k

2:15 pm on Oct 3, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I would go with some type of conf file, your function could build your menu based on what arrays/vars are set in the conf file. It may take a little more time to build but it will be the most flexible and doesn't add a db hit for every page.