Book Image

CMS Made Simple Development Cookbook

Book Image

CMS Made Simple Development Cookbook

Overview of this book

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.
Table of Contents (16 chapters)
CMS Made Simple Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

Introduction


If you're reading this book, you already know that CMS Made Simple is a powerful system for creating websites. Even the base install enables you to easily produce sites with many sophisticated features. There are times, however, when you need to be able to do things that are beyond the basic capabilities. You can often find pre-made extensions on the official CMS Made Simple sites: Tags and Modules in the Developer's Forge (or directly through the Module Manager), and examples of User-Defined Tags on Wiki or posted in the forum.

What are these different kinds of extension? This chapter will answer that question in greater detail. However, we will define them briefly here. All three types of extension share some things in common: they are PHP code which can be embedded in site pages, templates, or Global Content Blocks, or may be called by other code. A User-Defined Tag is distinct in that you can create and edit it through the CMSMS admin area. A Tag is similar, but must be placed as a file on your server, and provides more information to the site administrator. A module has available to it the rich functionality of the Module API, and enables the creation of much more complex applications.

As mentioned before, there is a wealth of pre-made extensions which are available to you. But even if these pre-made extensions don't meet your needs, all is not lost. You can jump in and create your own extensions! You will discover that the power of CMS Made Simple is only limited by your imagination.

Note

In this chapter, we will learn how to approach the problem you're trying to solve. Is it something that can be solved without writing an extension? Would you be able to use or adapt an existing extension? If not, what conditions will the extension need to handle? The requirements that you think of will help you determine what kind of extension you should implement.

There are three recipes here that will help you to identify which kind of extension is appropriate for a given problem, and three recipes that go over the basics of creating each major type.