MODX - The Official Guide

Building dynamic websites with the MODX content management platform

BobRay's book MODX-The Official GuideFinally! I got my hands on a copy of BobRay's book! And the first thing I saw when flipping it open to a random page was the "getParentIds()" function. It looks like I need to rewrite the old UltimateParent snippet to make use of this.

Get the Digital Edition  Get the Softcover Book

One very interesting feature of the book is the sections on Evolution, "Evolution Notes" at the end of the chapters. These notes describe similarities and differences in how Evo handles the subject being discussed. This will be even more significant as Evo development picks up and continues.

The book is over 700 pages, with 13 chapters and an extensive Appendix. While some of the softcover book's content is already obsolete at this point (what computer tech book isn't already partly obsolete by the time it gets published?) the vast majority of its content will definitely be useful. The digital edition is more up-to-date. Since I'm already intimately familiar with the basics of how MODx works on the surface - surface functionality hasn't changed much from Evo - I especially find the chapters on using the xPDO-based API invaluable.

The Basics

The first six or seven chapters cover the basics of how MODx organizes the content and functionality of a website. After describing how MODx works in general, they go on to explain the basic building blocks of Resources, Templates, Chunks, Template Variables, Snippets and Plugins. For new users, these are well-written and will give you a great insight on how best to leverage these resources and elements to build your sites while maintaining separation of content, presentation and function. For the old hands, they are worth at least skimming through, as they do cover the new twists Revo puts on some of our old friends, like Symlinks and Static Resources, and how all elements can have properties, and can be static elements pointing to files.

Coding the Revo Way

Chapter 8 is where things really start to heat up. Revo has a totally different core than Evo. This new core, based on xPDO, is fully OOP, MVC, and all sorts of other clever acronyms. But it really does open up whole new approaches to developing for MODx. While snippets and plugins still superficially perform the same functionality as they do for Evo, PHP coding for Revo is a whole new experience. Chapter 8 is over 100 pages explaining how to use the the xPDO-based API with all of its "get" and "set" methods. Object-oriented junkies will be right at home. Examples and tutorials abound.

Organization and Security

Next, in chapter 9, Revo's ability to rename the manager and put its core files outside of the web root are discussed, as well as the organizational possibilities in the concept of "contexts". Contexts make it possible to manage multiple domains and subdomains using the same MODx installation. They are also often used to provide pseudo-subdomains or subdirectories for managing multi-language sites.

Chapter 10 is arguably the single most important chapter in the whole book, as it demystifies the Revo user management system. Permission, Access Policies and Policy Templates, Roles, users, user groups and resource groups are all explained, along with how they fit in to the Access Control List model of Revo security. A number of tutorials working through several common scenarios help illustrate how it all comes together.

Chapter 11 describes how the Manager interface can be customized using Form Customization and Custom Manager Pages, instead of or in conjunction with user permissions.

Extending MODx

Chapters 12 and 13 deal with third-party add-ons, describing how to use the Package Management feature to easily install ready-made add-ons from both the official MODx repository and local packages, and how to create your own add-on packages.

Appendix

Finally, the extensive Appendix section has a wealth of useful information. It starts with the API, including xPDO functions, the xPDOObject class that is the foundation of everything, MODx object functions, and the modUser class.

The Appendix even includes a nice introduction to PHP programming, with of course tips and tricks particular to coding for MODx. Debugging and good coding practices are covered.

Using the MODx mail system to send mail via SMTP is described, and finally an exhaustive list of the system events, used to trigger plugin code to modify the behavior of MODx without modifying core files, is provided.

Conclusion

BobRay has for years been helping out newbies and experienced MODx users on the forums, and his Bob's Guides website has excellent articles, tutorials and blog posts on all kinds of things MODx, as well as some pretty good bread recipes. This book is definitely something that every MODx user, from designer to developer to content editor, should have handy. You can get it as an ebook in several formats, or as a paperback.

 

← phpMyAdmin on MAMPModxMODX3 →