homepage Welcome to WebmasterWorld Guest from 54.197.215.146
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderators: physics

Databases Forum

    
CMS navigation structure
el_roboto




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

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)
pageID
pageNAME
pagePARENT

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?

 

mattur




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

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"

HTH.

el_roboto




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

thanks for that :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved