CMS Made Simple Development Cookbook

Over 70 simple but incredibly effective recipes for extending CMS Made Simple with detailed explanations – useful for beginners and experts alike!

CMS Made Simple Development Cookbook

Cookbook
Samuel Goldstein

Over 70 simple but incredibly effective recipes for extending CMS Made Simple with detailed explanations – useful for beginners and experts alike!
$10.00
$44.99
RRP $26.99
RRP $44.99
eBook
Print + eBook
$12.99 p/month

Want this title & more? Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.
+ Collection
Free sample

Book Details

ISBN 139781849514682
Paperback340 pages

About This Book

  • Build new modules and tags, and use the built-in capabilities of CMS Made Simple to their fullest
  • Provides complete examples as well as educational starting points for your own projects
  • Designed to give you an understanding of the entire system
  • Covers CMS Made Simple version 1.9x
  • Step-by-step “recipes” along with detailed explanations

Who This Book Is For

If you are a CMS Made Simple user wanting to expand your skill set, or a programmer who wants to develop for CMS Made Simple, this book is for you. You will need working knowledge of PHP, HTML, and SQL. Some experience with CMS Made Simple is recommended.

Table of Contents

Chapter 1: 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
Chapter 2: 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
Chapter 3: 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
Chapter 4: 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
Chapter 5: 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
Chapter 6: 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
Chapter 7: 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
Chapter 8: 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
Chapter 9: Using Events
Introduction
Attaching a User-Defined Tag to an event
Finding what parameters an event passes using a User Defined Tag
Chapter 10: 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

What You Will Learn

  • Use template logic to achieve complex functionality without installing anything beyond the CMS Made Simple core
  • Create tags to achieve such varied tasks as filtering content and interacting with web services
  • Write fully-localizable modules in a maintainable and memory-efficient fashion
  • Interact with the underlying database using the API for safe, platform-independent access
  • Render and process complex forms and user interfaces with the Form API
  • Share your work with the community via the Developer's Forge and shared source-control repositories
  • Build admin-side panels so site administrators can manage and configure your module
  • Trigger and handle events for complex interactions with tags and modules

In Detail

CMS Made Simple has great capabilities “out of the box,” but one of its great strengths is the ease of extending those capabilities. You can add a surprising amount of functionality just by customizing the core modules, but once you learn to write your own tags and modules, your ability to add features is virtually limitless.

CMS Made Simple Development Cookbook will show you how to use custom PHP code to extend the power and features of CMS Made Simple, and make it do exactly what you want. This easy to use guide contains clear recipes that introduce the key concepts behind each approach to extending the CMS, while also providing examples of solutions to real-world problems.

You will learn the differences between the various kinds of tags and modules in the CMS Made Simple environment, and to which purposes each is best fit. Each technology is then explored in detail with a series of practical recipes and examples.You will not only learn the basics of creating tags and modules, but you will explore the underlying APIs that you will use to solve real-world website problems. You will become proficient with the database and form APIs, so that the code you write is portable and maintainable. You'll learn to localize your code and use templates to add its flexibility. You'll master the safe handling of parameters and the creation of secure code. You’ll be familiar with the CMS Made Simple Developer's Forge, and how you can use it in conjunction with revision control as a community-focused code management system, complete with web-based bug tracking and feature requests. You will learn to code complex interactions between modules, both directly and via the creation and handling of events. You will gain exposure to an array of advanced tips and tricks, along with commentary from the distilled experience of someone who has written dozens of modules. The CMS Made Simple Developer's Cookbook offers an amazing wealth of knowledge in approachable, bite-sized recipes. Whether you're new to the CMS or an old hand, you're sure to find valuable tips and information that will have you creating a richer CMS.

Authors

Table of Contents

Chapter 1: 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
Chapter 2: 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
Chapter 3: 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
Chapter 4: 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
Chapter 5: 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
Chapter 6: 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
Chapter 7: 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
Chapter 8: 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
Chapter 9: Using Events
Introduction
Attaching a User-Defined Tag to an event
Finding what parameters an event passes using a User Defined Tag
Chapter 10: 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

Book Details

ISBN 139781849514682
Paperback340 pages
Read More

Recommended for You

CMS Made Simple 1.9 Beginner’s Guide: LITE Edition
$ 9.99
CMS Made Simple 1.6: Beginner's Guide
$ 10.00