Hey all.

I've developed a site builder application that allows my clients to build/maintain 
their sites without my having to deal with tedious web design tasks.

The current version has some problems, however.

To resolve these issues I've switched over to an MVC (Model-View-Controller) 
structured site.

Great results so far except for one problem: the site directory structure.

Currently I have all page ids & titles stored in my "site_tree" table.

The site_tree table has the following structure:

prime_id (int auto_increment)
parent_id (int)
layout (int)
secure (int)
pop_menu (char 1)
title (var char 200) 

Here's some example to data to clarify the purpose of this table:

      prime_id parent_id layout secure pop_menu title 
      2  0  2  0  Y  Resources  
      3  0  1  0  Y  Memberships  
      4      2 3  0  N  Children and Youth 
      5  0  3  0  N  Events  
      6  2 1  0  N Adult Education 


Rows 3 & 5; i.e. Children and Youth & Adult Education, correspond to the parent 
category, Resources, whose prime_id is 2.

So, each child category's parent_id is the prime_id of the parent category and each 
child can be a parent to many children.

One use of this structure is to auto build the javascript popup menu for the site 
navigation (the pop_menu flag is used for this purpose).

The problem I'm having is retrieving data from, for example, the products table:

      prime_id page_id copy product_type 
      1 4  Test     1  
      2 6 Test1 1  


The products table page_id equals the prime_id of the site_tree table.  

When I query for product data based on the product category; i.e. Resources, which has 
a prime_id of 2, there is no matching record in the products table (since the products 
table only contains specific items, not category data).

So, what can I do to join the site_tree table with the products table and other 
similarly structured tables?

Please email for further details -- there's likely stuff I'm leaving out.

TIA for ny clues re: site tree models.....

--Noah
 



-- 
 

Reply via email to