Hi, all,
I'm starting to freelance soon and am creating a custom CMS to make setting up new sites and serving their content easier for myself. The system is to be installed on LAMP servers (PHPv4+). Currently, what I have for the system that generates the navigation for the created site (as opposed to that for the admin pages) kinda works, but I keep thinking there must be a better way of doing it. My question doesn't concern syntax so much as it concerns the schema.
For menus, essentially, MenuInstanceA of ClassMenuGenerator looks at all of the rows in the "aticles" database table and writes out the content of the row's "menu_text" field if the content of the row's "menu_ID" field correspnds to the "menu_id" menu being created by MenuInstanceA. In other words...
<?php
//for each row in "articles" table
//print "menu_text" if
//the row's "menu_id" matches
//the "menu_id" of the menu I'm creatng
?>
My purpose in doing it this way is so that I can dynamically generate the menus based on the content, as opposed to having to change the menus manually whenever I add content. This assumes that menu items will link directly to the content instead of linking only to pages that display content of type X. So, when I add a new page, I give it text and image content, select a menu for it to appear in, and create the text to be displayed in the menu (among other things).
The first problem is that if the created site grows to include many pages it could conceivably take a very long time to look at every article in the database just to print the homepage menu which might not even include any articles.
Second, I haven't quite figured out how to dynamically integrate into the same menu items form the “articles” database table with items from, say, the “products” database table (without simply printing one menu after the other).
Any advice or links to tutorials or other forums, etc. will be greatly appreciated. For the record I have trolled the web and many forums looking for the answer already.