Hello, I am having some issues setting up the database for my base CMS to use for all clients. My thoughts were to have the following:
blocks table - this is simply the html, title, description etc for each page (i.e. home, about us) menus table - simply contains the menu name (i.e. top navigation or footer links etc) menu_items table - this would contain the menu_id, the parent_id (from this same table), the title of the link in the menu and then there would be a controller field which would contain the name of the controller i.e. blocks and then the next field to contain the actual block id such as the home id for the link. This is how I can see that I can easily add additional controllers such as galleries, pdfs, blogs etc and they could be within the menus quite easily by adding in contoller => pdfs, controller_id => 3 (the pdf id or whatever) Below is the SQL I have come up with, I wanted to get some advise to see if there was an easy way or better way to do this. Ideally I want to be able to generate the list of controllers on the add/edit field and then their assigning ids when adding menu_items. Thankyou ================================================ CREATE TABLE IF NOT EXISTS `blocks` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(150) NOT NULL, `title` varchar(150) DEFAULT NULL, `show_title` tinyint(1) DEFAULT '1', `content` longtext, `metadescription` text, `metakeywords` text, `stepback` longtext, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; # Data exporting was unselected. # Dumping structure for table siteadmin.menus CREATE TABLE IF NOT EXISTS `menus` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; # Data exporting was unselected. # Dumping structure for table siteadmin.menu_items CREATE TABLE IF NOT EXISTS `menu_items` ( `id` int(11) NOT NULL AUTO_INCREMENT, `menu_id` int(11) DEFAULT NULL, `parent_id` int(11) DEFAULT NULL, `name` varchar(255) DEFAULT NULL, `controller` varchar(255) DEFAULT NULL, `controller_id` int(11) DEFAULT NULL, `published` tinyint(1) DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; ============================================== -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php