Modules
The first step to creating your own content module is to create a new content table in the CMS database. The content tables are usually named pages_ModuleName. For example a content module for articles might be called pages_Articles.
The table has a few required fields. It must have a primary key field, of auto_increment integer type. It also must have a field named Page_Id to let the CMS know what page the content is assigned to. You also probably want a field named Page_Updated to keep track of when the content has been last updated.
This could be an example table description.
+---------------+-------------+-----+----------------+ | Field | Type ...| Key | Extra | +---------------+-------------+-----+----------------+ | Article_Id | int(9) un...| PRI | auto_increment | | Page_Id | int(9) un...| | | | Article_Title | text | | | | Article_Author| text | | | | Article_Text | text | | | | Page_Updated | datetime | | | +---------------+-------------+-----+----------------+
The second step is to add the table definition to the CMS. First add the table using the <span class=">Tables table. Next add the fields to the Table Fields table. Make sure to set the key field as Primary Key type. By choosing the other field options you can make it easier for people to edit this content type. For example in my article module you could choose the Html Editor type for the Article_Text field. And if you wanted to add an photo for the article you could add another fieldl to the table and use a FTP field type to upload a photo.
Finally add a row to the Modules table. The Module Code section is where you define how the content is displayed. The format is the same as a template, and you can use the same variables described in the template documentation.
The only difference is that the Module Code field defines the $this->PAGE["cms_content"] variable for use in a template. You can also define the $this->PAGE["cms_title"] variable here.
Here is an example Module Code field for my articles module.
<h2 class="title"><? echo $this->PAGE["Article_Title"]; ?></h2>
<p>By <span class="author"><? echo $this->PAGE["Article_Author"]; ?></span></p>
<? echo $this->PAGE["Article_Text"]; ?>






















