PostNuke Help

Previous
Module Directory Structure

Home
up

Next
Initialisation Functions


Building Your Module

Make Your Initial Directory

Create the directory to hold the module files. This directory must be created under the 'modules' directory in the PostNuke install, and must be created with the name of your module as registered at the PostNuke modules site.

Copy the Module Template

Copy over all of the files from the template directory into you newly created module directory. These files set up the basic structure for your module and allow you to get to work creating your module very quickly.

Code your Database Tables

Coding your database tables requires you to edit the pntables.php file in your module directory. This file gives information on the structure of the tables used by this module, although it does not carry out any actions itself. The structure information is wrapped in a function (modname_pntables()) for easy access by the PostNuke system. An annotated copy of the template pntables.php file is available in the standard PostNuke distribution as part of the Template module.

If your module uses tables specified by another module then you can either remove the pntables.php file completely from your module directory, or have a suitably named function that just returns an empty array.

Caution: If you attempt to use the same table name as another module or the PostNuke core then your module will fail in unexpected ways. Try to give your tables unique names, preferably based on your module name.


Previous
Module Directory Structure

Home
up

Next
Initialisation Functions