Table of Contents

  1. Introduction
  2. Adding Modules
  3. Creating Modules
  4. Changing the main Splash Screen
  5. Creating a Skin
  6. Sharing your modules / skins / splash screens

Introduction

Lemon CMS is a very simple to use content management system.  It uses a flat file system which makes it easy to configure and port into any existing website or to any new website. 

This documentation details the steps that can be taken to further customize your copy of Lemon CMS.  The instructions detailed in this document are NOT neccessary to get your copy of Lemon CMS up and running, these are additional steps that can be taken to further customize your CMS by adding modules or creating skins for it.  They should only be taken if you are interested in changing the look of your Lemon CMS or to add additional modules.  For instructions on setting up Lemon CMS into your site please refer to readme.htm.

Adding Modules

As of Lemon CMS v1.1.0 you now have the ability to snap-in modules into the CMS.  Adding a module is very simple whether the module is created specifically to be used with Lemon CMS or you wish to port an existing PHP script into Lemon CMS.  

To add a module created for Lemon CMS, simply copy the module into a sub-directory in your lemon_includes/modules/ directory. Now simply refresh your browser window, if the module was properly created you will notice it has appeared in your menu.

If you wish to de-activate a module so that it does not display in the CMS menu simply open the .mod file for that module and change the 4th line from a 1 to a 0.  If you wish to reactive a disabled module simple change the 4th line in the .mod file back to a 1.  

To remove a module completely simply delete the .mod file and directory from your lemon_includes/modules directory for the module you wish to remove.  

Creating Modules

Creating a module is simple and requires two steps :

  1. Create a .mod file to configure your module in lemon_includes/modules/
  2. Create a sub-directory in lemon_includes/modules/ and copy your module in there

Both the directory and the .mod file should have the same name eg preferences.mod and preferences

Step 1: Creating and configuring a .mod file

In the directory lemon_includes/modules/  simply create a file with the extension .mod. The first 4 lines of data in .mod file are used to setup the configuration of your module.  

Line 1 = The sub-directory that the module is housed in
Line 2 = The display title of the module as it will appear in the CMS Menu
Line 3 = A short description of the module which will be used as the title HTML tag in the menu display
Line 4 = Module Status.  1 = On, 0 = Off.

Everything after line 4 is omitted.  This space can be used for a full description of what the module does and how to configure it.

A preferences module is included with this distribution which can be used as an example.

Step 2: Creating a module for Lemon CMS

Create a directory under lemon_includes/modules/  that will house your module (make sure that this directory has the same name you specified in the .mod file).  Give it a logical name so that it is easy to identify. 

Lemon CMS will look for index.php in your module directory.

The main thing to remember is NOT  to use echo or print, instead store all string data in the variable $content.

Constants used in Lemon CMS are defined in the lemon_includes/config.php file and they are
 
_PATH   the root path where Lemon CMS is stored
_PATHCONTENT the root directory of where your website is stored
_URL    the URL to Lemon CMS base directory
_URLCONTENT  the URL to where your website is stored

Config variables are also stored in the lemon_includes/config.php file and they are

$FILETYPES['editable']     Filetypes that can load in the editor
$FILETYPES['notuploadable']  Files that cannot be uploaded via the CMS
$FILETYPES['DefaultExtension'] The default extension added to files created in the CMS.  Include the ".".  For no default extension

$CONFIG['skin']      The skin used in the CMS.
$CONFIG['modules']    If Modules should be active or not.

To use the config variables you must first make them global by including the following statements :
 global $FILETYPES;
 global $CONFIG;

This is not neccessary for constants as constants are defined as super globals in PHP

You can use the preferences module as an example.

If you have an existing script you wish to use in the CMS adding it should be as simple as creating a .mod file, converting all echo/print commands and verifing the paths are correct.

Creating a Skin for Lemon CMS

As of Lemon CMS 1.10 you have the ability to skin the CMS. If you have some knowledge of CSS this is a simple task.

Skins are stored in lemon_includes/templates/skins/

Create a directory for your skin in lemon_includes/templates/skins/ giving it a logical name.  Copy over the default skin directory to use as a template and edit it as you wish.

If you have the preferences module turned on (as it is by default) your new skin will automatically be selectable from the preferences module.  If you would like to set your new skin to the default skin for Lemon CMS simply modify your lemon_includes/config.php to load the new skin by default.