PacktLib: CMS Made Simple Development Cookbook

CMS Made Simple Development Cookbook

Credits

About the Author

About the Reviewers

www.PacktPub.com

Preface

Understanding CMS Extensions

Introduction

Will a User-Defined Tag solve my problem?

Will a Tag Solve My Problem?

Will a Module solve my problem?

Create a "Hello World" User-Defined Tag

Create a "Hello World" Tag

Create a "Hello World" Module

Using CMS in Debug Mode

Programming with Smarty and Core Modules

Introduction

Using Smarty to create a color set in your stylesheet

Using Smarty to do the math in your stylesheet

Getting the Most out of Tags and User-Defined Tags

Introduction

Displaying the User's IP address from a User-Defined Tag

Using the CmsObject and the current content object in a User-Defined Tag

Making a variable available to Smarty

Displaying the number of pages in the CMS using a User-Defined Tag

Using URL parameters safely in a User-Defined Tag

Using Smarty values as inputs in a User-Defined Tag

Displaying stock prices from Yahoo with a User-Defined Tag

Displaying a translation of the current page using Babelfish with a User-Defined Tag

Posting an article to the News Module when the Admin adds a new Group

Reversing a string in two ways using a Smarty Modifier

Adding registered trademark symbols to a name automatically

Getting Started with Modules

Introduction

Creating the file structure for a module

Creating a new module stub using the Skeleton module

Creating a new module stub using the ModuleMaker module

Breaking a module into multiple files

Making a module localizable

Using the Database API

Introduction

Creating a database table when a module gets installed

Creating a database index when creating a table

Making a database query from a module

Creating and using a database sequence

Altering a database table when a module gets upgraded

Cleaning up when a module is uninstalled

Using the Module Form API

Introduction

Creating a basic form in a module

Restricting and sanitizing parameters to a module

Using debug_display or error_log to see what parameters your module is receiving

Your Module and the Community

Introduction

Creating an account on the CMS Made Simple Developer's Forge

Adding your module to the Forge

Creating your Subversion Repository

Using Subversion while developing your module

Publishing a module release

Creating your Git repository

Using Git while developing your module

Deciding on Git versus Subversion

Creating Useful Admin Panels

Introduction

Creating an admin panel for your module

Creating multiple tabs for your admin module

Creating and enforcing new permissions for your module's administration

Displaying a page in the CMS Admin without the surrounding theme

Writing a line to the CMS Admin Log

Displaying a message after installation

Creating an admin-side input element from your module using a ContentModule block

Hiding your module from Administrators who don't have permission to use it

Creating a module-specific preference and admin panel to set it

Displaying an alert in the CMS Admin from a module

Using Events

Introduction

Attaching a User-Defined Tag to an event

Finding what parameters an event passes using a User Defined Tag

Advanced Module Tricks and SEO

Introduction

Overriding Module strings or layout

Making your module's data available to CMS Site Search

Outputting a downloadable CSV file from your module

Setting special diagnostic messages for debug mode

Using Pretty URLs in your module