Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

CMS navigation structure



8:42 am on Jun 21, 2007 (gmt 0)

5+ Year Member

I'm not sure if I should post in PHP or Databases with this one.

I'm about to embark on a project involving the build of a content management system (MYSQL + PHP).

Have decided on a list of functionality and features which need to be included and now am thinking through the build and operation of the whole thing.

I'd like to be able to provide a multi tier navigation system.

I'm planning for a table cmsContent to contain the following fields (I'll just list those relevant to this discussion)

the value of pagePARENT may be NAV_MAIN_MENU, NAV_INDIVIDUAL, or a 'pageNAME' value.

This allows a hierarchy to begin being created ie; a page with pageNAME 'steven' might have a pagePARENT 'the_team', pageNAME 'the_team' has pagePARENT 'about_us', pageNAME 'about_us' has pagePARENT 'NAV_MAIN_MENU'

I'm now trying to establish the best way of tracing this heirarchy from the page root so that I can create navigation links and create a breadcrumb trail.

<a href="/about_us/the_team/">Meet the team</a>

<a href="/about_us/the_team/steven/">Steven Brown</a>

(I'll be using mod_rewrite to deal with URL's in the manner above.)

What are your thoughts on the best way to achieve this?

I was also wondering if there would be any use in adding a field pageTIER with a numerical value to check how deep into the navigation tree a page resides?


1:26 pm on Jun 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Hi el_roboto,

There's a good article on sitepoint detailing a couple of methods; not sure if I should link so google "Storing Hierarchical Data in a Database"



2:46 pm on Jun 24, 2007 (gmt 0)

5+ Year Member

thanks for that :)

Featured Threads

Hot Threads This Week

Hot Threads This Month