This package provides basic / generic content management system for any Zend Framework based project. It is aimed to be inlcuded as a part of an adminitration interface, but could me modified for multiple users with different content-page listings.
- Content page listing with actions - Edit, delete and publish / unpublish pages
- Integrated with the TinyMCE rich text editor
- TinyMCE Lionite image manager plugin included
- Prepared controller and route for viewing content pages with nicely formatted URLs
- Minimal HTML markup and basic styles included. Easy to skin and adapt
Please visit the demo page for a demonstration of the CMS.
Integrating package contents
The package contains the following elements:
- Controllers - The ContentController should be placed in your administration module if you use modules, or otherwise restricted access based on identity. There is no authentication logic in the CMS as its meant to be integrated with an existing system. The PageController should be placed on your public site module or in your regular controller directory if you are not using modules (/controllers).
- Models - Content_Pages.php should be placed in your models directory.
- Views - the /content and /page directories should be placed in the same module as related controllers. If you aren't using modules, place them in your regular view directory (/views/scripts).
- Layout - A layout is included along with header and footer templates. In the case you already have a layout in use, you can disable it by removing the init() method in the controllers.
- View helpers - several custom helpers are included in the package. All of those are related to content editing, so put those in the same module as ContentController or in your regular helper directory if you are not using modules (/views/helpers).
- Content page route - The route setup is defined in the routes.php file. The $router variable is Zend_Controller_Router you use for your application, so you should add the route where that router is available. That would usually be in your bootstrap file if you follow the standard application format.
- Public files - Images, Javascript, Stylesheets - the contents of the /public directory should placed under the public directory of your application.
Database setup
Import the included content_pages.sql file into your database (you will need to create one if you didn't have one already). If you didn't use a database previousl in your project, you would need to configure the database adapter with your database settings (name and credentials).
$options = array(
'host' => 'localhost', // Hostname of the database. Usually 'localhost'
'username' => 'db_user', // Your database user
'password' => 'db_pass', // Your database password
'dbname' => 'db_name' // Your database name
);
$db = Zend_Db::factory('PDO_MYSQL', $options); // Create database adapter
Zend_Db_Table_Abstract::setDefaultAdapter($db); // Assign default Zend_Db_Table adapter
A common practice is to load the database settings from a configuration file and then assign it to the adapter.
Questions & Comments