Tips, Tricks and How-Tos from the MODX Forums

About the Cookbook

The MODX Forums

Ever since MODX began, the user community has been a vital part of its progress. From providing bug reports and patches, add-ons and tutorials, it's the users that make it go. And from the beginning the forums have provided the primary gathering place for the community. There were a couple of newsgroup channels for MODX and xPDO, and now there are some Google groups and several Twitter accounts for getting in touch with other developers and keeping up with what's going on with MODX, but it's the forums that form the backbone of the community.

For many years the forums were hosted on a SimpleMachines installation. Then in September of 2011 they were moved to a native MODX forums app, which was later released as Discuss. Irrespective of its platform, for all those years it's been the main source of all things MODX.

This book is a compilation of questions and solutions mostly taken directly from forum posts. Over the years just about anything you can imagine doing with a website has been discussed, and in many cases more than one solution given to any one question. Some of the recipes are questions that may never have been explicity posted, or are buried in larger issues, but experience has shown that they are good things to know anyway. And scattered here and there you'll find a few of my favorite food-type recipes, the quick and simple kind that busy developers might find useful.

Some Initial Presumptions

A number of presumptions are made in this book. The book is not intended as a web primer, nor a PHP tutorial. It is presumed that the reader has at least a basic knowledge of web design using HTML and CSS, and of web development using PHP, although an experienced developer in any programming language shouldn't find it difficult to understand what is going on here.

It is, for the most part, presumed that the reader will have some understanding of what a CMS is and how they work. On the other hand, MODX is in many ways fairly unique in the way it handles site themes or templates, as well as its manner of organizing discrete blocks of dynamic content, so there are "light" recipes as well as more hearty fare.

MODX is also an application framework, based on an extension to PHP's PDO database abstraction library, xPDO. It is hoped that the reader has some understanding of how relational databases work. MODX supports both MySQL and MS SQL Server, but this book will primarily focus on working with MySQL, since that's what I'm familiar with. Anyone familiar with MODX and MS SQL Server is more than welcome to contribute to this book!

While the basic Web technologies will be covered to some extent, again, this book is not intended to be a PHP, Javascript, HTML or CSS tutorial. Any quick web search will turn up hundreds of pages full of tutorials for these. The Appendix lists a few that I have found to be the most useful.



  • Tutorials
    Sites that I have found useful for learning HTML, CSS, Javascript, PHP and MODX.
  • Development Tools
    Some useful extras to help with development tasks.
  • Managing Your CMS
    Organizing and managing your resources, elements and files.