Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Books Book Reviews

Book Review: MODx Revolution - Building the Web Your Way 70

First time accepted submitter matria writes "MODx is a free, open-source Content Management System and Framework, developed and supported by MODX LLC and a global community. The latest iteration of MODx, called Revolution, is entirely object-oriented. To take advantage of the power of MODx, the developer needs to learn how MODx works and how to use its building blocks to extend it to satisfy his purpose. While there is official documentation and a number of websites with tips and tutorials, as well as an active and friendly forum, for the dedicated developer one of the publications that it is good to be aware of is W. Shawn Wilkerson's MODX Revolution — Building the Web Your Way." Read below for the rest of matria's review.
MODX Revolution - Building the Web Your Way: A Journey Through a Content Management Framework
author W. Shawn Wilkerson
pages 622
publisher Sanity Press
rating 9/10
reviewer matria
ISBN 0985853204
summary an extensive look at an amazing and extensible Content Management Platform
Known to the MODx community as "sottwell", I've been a developer and contributor to MODx since its beginnings, so I'm well-familiar with W. Shawn Wilkerson's contributions to the MODx community over the past six years. He is the founder of Sanity LLC, a technology integration company, and holds 9 degrees in programming and web design. His book on MODx Revolution, subtitled A Journey Through a Content Management Framework, was published in August of 2012 by Sanity Press, with ISBN 978-0985853204. It has some 600 pages, with 19 chapters divided into 5 sections.

This begins with the obligatory introduction to what MODx is (and is not). Use MODx as it installs for nearly instant, fully-functional sites, or turn it into a framework for complex web applications.

The second chapter introduces the Manager interface. This is an excellent place to start for new MODx users. We are taken step-by-step through the Manager, with each feature and function explained. Of special importance is the tree structure that lists the content Resources that provide the main content elements for each page, this tree structure reflecting the overall site structure.

Shawn explains how the Manager itself is built on the core MODx framework, and so it is customizable and even totally replaceable

The next five chapters discuss the basic building-block elements that are used to build a MODx site. The coverage of these elements is by no means superficial, everything from customizing the Manager forms for creating and editing them to how they are stored in the database to how to format and manipulate their final output on your web page is explained. Plenty of actual useful code samples and in-depth explanations make it easier to understand how MODx builds up a site using these modular blocks of content and content-generating elements. One entire chapter on Output Modifiers caught my attention here, as it covers a topic often overlooked or, conversely, overused.

The Quick Start chapter walks through the simple procedure to create a basic website after installing MODx, from a few basic System Settings such as a name for your site, through setting up the Template for your pages and assigning it to the Resources that will provide the main content for the pages, using Chunks, Snippets and Template Variables to add dynamic content to your pages, and installing and using third-party add-ons via the handy Package Manager. A complete site, with a dynamic menu structure, search functionality and a contact form can be set up in less than an hour, using any one of thousands of free HTML templates as the base Template.

The rest of this section goes on to show how common Web essentials such SEO, AJAX, friendly URLs and .js and .css minification can be easily arranged, to how a full-blown blogging platform can be added to your site with the Articles package.

One of the more frequent questions that comes up in the forums is how to use JQuery or other libraries, or how to handle AJAX in MODx. Basically, MODx doesn't interfere with your css or javascript in any way. But there are speed and optimization considerations in how and where Javascript links and code should be inserted, and MODx APIs can make processing AJAX requests or inserting data into Javascript functions clean and easy. A chapter on Javascript, CSS and JQuery works through several examples of how various features of MODx can be leveraged to automate best practices for everything from a simple JQuery slideshow to a complete AJAX-driven web application.

The MODx Revolution user management system is a complex network of users, user groups, roles and policies, based on the ACL model of user management. This section is vital to understanding how to control and manage user access to both protected sections of your front-end site and limit Manager functionality. With plenty of screen shots and examples, the reader is gently guided through the whole inter-related subject of organization and controls.

The chapter on Contexts explains how this feature can be used for dividing the site into sections. Contexts can be used to manage separate domains, allowing multiple websites to be managed from one MODx installation. They are also used to provide virtual subdomains or subdirectories for easy management of multi-language sites. Again, plenty of screen shots and examples open up the possibilities of using Contexts. Some of the limitations and pitfalls of using Contexts are explained and resolved.

Since this is not exactly a beginner's tutorial on OOP, the section begins with a brief overview of what OOP is, with some useful links to OOP and OOP in PHP tutorial sites. Then it continues by describing the fully object-oriented MODx Revolution API and the basic $modx object. MODx, like most CMS applications, relies heavily on the database, so there is an emphasis on understanding the database access methods and how MODx stores and caches data. Using the API simplifies just about every facet of MODx development, and the explanations and examples here make this a good reference to keep close at hand.

The foundation of MODx Revolution, the xPDO ORB/ORM object library, is extensively discussed. Coding best-practices are discussed. Real-world, complete, functioning and useful examples abound.

The section ends with how to install and use third-party add-on packages, and how to create your own packages.

Everything from MODx Revolution terminology through system settings and how the MODx parser works, ending with an interesting set of "rules", shared nuggets of hard-won programmer philosophy, make the Appendix another useful resource.

The book is clearly based on a deep understanding and love of programming, web development, and of MODx Revolution itself. One thing I especially appreciated about the layout of the book is the extra large font used for the code examples. It does't make for a pretty layout, but it's a great improvement in usablity over the usual prettier blocks of small, often hard-to-read text. This is even more significant when considering that Shawn is the founder and CEO of Sanity/Sanity Press. While typos and grammatical errors are common, this was understandably explained by the need to get such a book published and available before the fast movement of the web development world in general and MODx in particular make it at least partially obsolete. A year later, it's still covering material well within the leading edge of MODx Revolution functionality. The occasional personal ramblings actually give us an insight into Shawn's programming philosophy, and make the whole book seem more like a personal message, almost a conversation, than a cold presentation of facts. Overall, this is an excellent book, I very much enjoy it, use it, and recommend it.

You can purchase MODX Revolution - Building the Web Your Way: A Journey Through a Content Management Framework from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
This discussion has been archived. No new comments can be posted.

Book Review: MODx Revolution - Building the Web Your Way

Comments Filter:
  • Argh (Score:2, Interesting)

    by Anonymous Coward on Monday April 08, 2013 @02:57PM (#43393985)

    My brain was unable to properly categorize this post. What language is this MODx thing built on? Is it a cool language like C, Perl or Python? Or a potentially hip thing with Javascript? Or is it built on something that makes me cringe, like ASP? Does it run on Unix? Node? Apache? Microsoft? The "Cloud"?

    Without knowing any of these things, I'm not sure how to categorize this story, and I can't decide if I want to read this to learn or to condescend.

    Oh wait ... "He is the founder of Sanity LLC, a technology integration company, and holds 9 degrees in programming and web design.". There it is. It's condescend.

  • by YurB ( 2583187 ) on Monday April 08, 2013 @05:04PM (#43395063)

    I was using MODx Revolution for around two years, and it has many good sides, about which you can read on their website, in the books they published and in their wiki. But there are also some issues that led me to seeking an alternative now. MODx developers, please take this as an attempt of constructive criticism (and sorry for my imperfect English).

    • Too much is stored in the db, and that makes it very hard to work with git. Even with the 'static elements' functionallity one must have the actual 'element' in the database even if the code is stored in a file.
    • Poor performance of the backend. The backend is implemented entirely on ExtJS and is slow. Despite it's ExtJS it still requires to reload the page too often.
    • Very hard to develop own stuff on top of it. Just take a look at the tutorial on creating an extension [modx.com] (called 'extra'). I've developed different 'extras' to implement custom functionality in my projects, and I constantly had the feeling that they just made simple things much overcomplicated.
    • Poor documentation. Just take a look on their API docs [modx.com]. For example, the documentation for the modX::addExtensionPackage() function just says: "Add an extension package to MODX", and no information on the arguments besides what types they are.
    • Some serious problems in the core. For example, the widely used function modX::getChunk() has a performance bottleneck and can't be used in anything like, for instance, displaying a big list of products on a page, despite that this is exactly what it's for. If one instead reuses a same chunk object to iterate through a set of DB records (using $chunk->process()), the performance is dramatically increased. This issue has been reported on the forums, but didn't catch much attention (I can't even find the thread now.) The getChunk() function is widely used in some very important modx extensions, and yet the performance bottleneck doesn't seem to bother to the MODx community.

    This isn't the full list. This is just some random (but major) inconveniences I can recall right now. To me, MODx is a great idea which for some reason wasn't implemented well.

A morsel of genuine history is a thing so rare as to be always valuable. -- Thomas Jefferson

Working...