Core Concepts
Connecting to the main content
There are two additional models which manage the core content:
- Page(): this is the administrative module, so it has all of the crud capabilities
- ContentPage(): this is the public page object which is sent to the main instance of the view. all crud functions except some reads will return false.
The content_type
The content type field is used to distinguish between different forms of content. The core Content model handles these content types, so your models will act like normal Zend_Db_Table models. fetchAll() for example will just return records of that type.
Setting the type
When you create a new content model in the scope of this cms you want to extend the Content model.
<?php
class NewsItem extends Content
{
protected $_type = 'newsItem';
You specify the content type in the first protected property $_type. This type can be anything you want, but must be unique.
If you are familiar with the zend framework note that rather than setting $_name (Content already knows that) you are setting the $_type.