CMS Made Simple™ Developer Resources : : CMS Made Simple Developer Documentation
CMS Made Simple™ Developer Resources
Intro
Module Development
What is a Module?
Module Basics
Best Practices
Header Requirements
Install / Uninstall / Upgrade Methods
Module Directories and Paths
Including a Software License
Module Security
Checking Permissions
Data Validation
Nonces
Securing (Escaping) Output
Securing (Sanitizing) Input
Events
Sending Events
Handling Events
Core Events Reference
Hooks (HookManager)
Admin Interface
Admin Actions
Admin Tabs and Navigation
Admin Forms and Smarty Plugins
AJAX in the Admin
Smarty Tags
Content Block Tags
Plugin Tags
Tag Parameters
Preferences
Module Preferences API
Site and User Preferences
Database Operations
Using ADODB
Creating Tables
Schema Management
Templates
Smarty Templates
Admin Templates
Frontend Templates
Design Manager Integration
Users and Permissions
Roles and Permissions
Custom Permissions
Internationalization
Language Files
Using Lang Strings
Assets and Resources
Loading CSS and JavaScript
Images and Icons
HTTP and REST APIs
Cron
Guidelines
Module Guidelines
CMSMS Compliance Guidelines
Security Guidelines
Code Quality Guidelines
Tutorial
Building a Holidays Module
Getting Started
Install, Uninstall, and the Databas
The Model Class
Admin CRUD
Frontend Views
Pretty URLs and Routes
Search, Lazy Loading, and AJAX
Holidays Starter Pack
Forge
Submitting Your Module
Module XML Packaging
Developer Tools
Module Check
Support
Module Handbook
Welcome to the CMS Made Simple Module Handbook. This resource is the definitive guide for developers who want to build, maintain, and distribute modules for CMS Made Simple (CMSMS).
Modules are the primary way to extend the functionality of CMS Made Simple. They can add new content types, admin tools, frontend features, API integrations, and much more — all without modifying the core system.
What You'll Learn
This handbook walks you through every aspect of module development, from creating your first module to publishing it on the CMSMS Forge:
Introduction to Module Development
— Understand what modules are, how they fit into the CMSMS architecture, and what you can build with them.
Module Basics
— Learn the required file structure, header requirements, install/uninstall/upgrade lifecycle methods, directory paths, and licensing.
Module Security
— Protect your module and its users with proper permission checks, input sanitization, output escaping, CSRF protection, and data validation.
Events
— Send and handle events (CMSMS's hook system) to let modules communicate with each other and with the core.
Admin Interface
— Build admin panels using actions, tabs, and navigation within the CMSMS admin area.
Smarty Tags
— Create frontend tags that content editors can use in pages and templates.
Module Preferences
— Store and retrieve module settings using the Preferences API and site-wide preferences.
Database Operations
— Work with the database using ADODB, create and manage tables, and handle schema migrations across versions.
Background Jobs
— Schedule one-time and recurring background tasks using the CmsJobManager async job system.
Templates
— Use Smarty templates for both admin and frontend output, following CMSMS conventions.
Assets and Resources
— Load CSS, JavaScript, images, and icons in admin and frontend contexts.
Users and Permissions
— Integrate with the CMSMS permission system, create custom permissions, and check user roles.
Internationalization
— Make your module translatable with language files and the Lang() method.
The CMSMS Forge
— Package, submit, and maintain your module on the official CMSMS module repository.
HTTP and REST APIs
— Make external HTTP requests, build REST integrations, and comply with external service disclosure requirements.
Developer Tools
— Use diagnostic tools like Module Check and CMSMS Scanner to audit your module for best practices, security, and compliance.
Module Guidelines
— Reference of all compliance, security, and code quality rules enforced by Module Check.
Tutorial: Building a Holidays Module
— A hands-on, step-by-step guide to building a complete working module from scratch.
Prerequisites
Before diving in, you should have:
A working CMS Made Simple 2.2.x installation (2.2.16 or later recommended).
PHP 8.2 or later.
Basic knowledge of PHP, HTML, and SQL.
Familiarity with the
Smarty template engine
Access to the
modules/
directory on your CMSMS installation.
Hands-On Tutorial
New to CMSMS module development?
Start with the
Tutorial: Building a Holidays Module
. It walks you through creating a complete module from scratch in 7 step-by-step chapters. Or grab the
Starter Pack
to download and install the finished module immediately.
How This Handbook Is Organized
Each chapter focuses on a single topic and builds on the previous ones. You can read it front-to-back as a reference, or follow the hands-on tutorial first and then use the chapters to go deeper on specific topics. Code examples use real CMSMS API calls and follow current best practices.
Throughout this handbook, you'll see references to the
CMSModule
base class — this is the class every module extends. Understanding its methods and lifecycle is the foundation of CMSMS module development.
Getting Help
CMSMS Forums
— Community support and discussion.
CMSMS Documentation
— Official documentation wiki.
CMSMS Forge
— Module repository and issue tracking.
CMSMS on GitHub
— Source code and contributions.
Continue to Next page:
Introduction to Module Development
US