I was contacted recently by Packt Publishing. They asked me to review MODx Web Development by Antano Solar John, a book they published about the popular MODx PHP framework and content management system. Having heard of but never used MODx, I felt I was in a pretty good position to review the book, so I agreed to do so.
However, as soon as I started to read it, I realised that I’m probably not actually the target audience for this book and thus not the best person to be asked to review it. It appears to be more of a “Getting Started with MODx” style walkthrough, as opposed to a reference book – for developers or otherwise. So whilst I have set out to give this book a fair review, I will be doing so from a developer’s perspective and this may not be representative of it’s usefulness to the average webmaster.
Chapter Outline
Chapter 1: What is MODx? – This chapter does a relatively good job of explaining what MODx is, including definitions of what a content management system is, what a template system is, and the general architecture of a database-driven web site. There are a few misunderstandings on the part of the author that make it feel a bit patronising and it comes across in some ways as a bit of a buzzword party. These include describing use of friendly URLs as ReST – a notion that can bring out intense rage from actual ReST fans, such as Ben – or the description of Web 2.0 as being sites in which the content is generated by the user, and the suggestion that a CMS makes creating Web 2.0 sites easily. Some content management systems can do this, but on the most part, that is not their purpose.
Reading the final page of this chapter as an experienced web developer does not inspire much confidence in the rest of the book, however. The author describes the administration system in MODx as being AJAX driven, and thus “really user friendly”. Now – I understand that AJAX extensions can indeed make your applications *more* user friendly, when implemented well, but this is not as a result of the technology itself, but of the usability skills of the developer that implemented it. Secondly, the author suggests that MODx is search friendly, and provides everything you need to get your site listed in Google. Leaving aside the obvious requirement for off-site optimisation for search, the content management system is generally not even what matters for on-site optimisation, it’s the templates you give it. If your templates are rubbish, there’s nothing a content management system can do to help you.
Chapter 2: Getting Started - This chapter starts with the prerequisites for MODx installation, along with how to set up XAMPP (Windows/Linux) or MAMP (Mac) to test it on. This is a few pages I feel would have been best left as an address of an online guide, or similar, but leaving that aside, the instructions seem simple enough. There’s a small niggle with the section that doesn’t suggest the best editorial oversight on this book – which is that brand names for operating systems are not adhered to. Windows does not carry a trademark symbol, and Apple’s Mac platform is referred to as MAC throughout – Mac is a brand name, not an acronym. The same applies later in the chapter in the form of several typing mistakes. Following on from that, the instructions for installing MODx itself seem comprehensive and appear to cover most obvious questions as you go through.
The chapter closes with an introduction to what documentation and support is available for MODx on the internet. This is great. The section explains clearly what each resource is and what it’s useful for, along with general etiquette expected by the MODx community when using the provided resources.
Chapter 3: MODx Basics – This chapter, as the name suggests, will teach you the basics of MODx. The first thing it taught me, however, is a bit about the author of the book – including his GMail address, del.icio.us username, and his interest in the subject of Cross Site Scripting. This goes back to my earlier mention of editorial oversight, the screen shots in this chapter were obviously all taken by the author, using his own browser, whilst browsing other sites – a bit of a no-no if you ask me. The chapter does a good job of introducing you to some of the core concepts in MODx, such as “documents” being the key element. It also provides a good top level overview of various sections of the management panel, some of the things they do, and how they should be used.
Chapter 4: Templating - This is the first section I thought I could really get my teeth into, even if it’s not development per-se, it’s a technical subject. Unfortunately, it continues at the same slow (for me) pace that the preceding chapters started and I think the most interesting thing I learned is that MODx uses an absolutely crazy variable syntax, or should I say multiple? There’s [*#content*], [!Snippet? &variable=`value`] and my personal favourite [~[*id*]~], amongst others. It strikes me that this is as a result of a poorly written template parser, but I truly hope I am wrong.
Chapter 5: Authentication and Authorization - This section starts out by, fairly clearly, explaining what these two things are, followed by how to get started with adding a log in box to your site. It does throw in some un-necessary guides to changing your site layout from one to two columns, which confused me a little, but otherwise it starts off well. It then goes on to explain how you can restrict access to certain content and functionality to users, or groups of users on your site. Finally it covers how to allow users to register on your site, following very much the same format as the rest of the book.
By this point, you’d have a simple blog site that allows members to sign up and post comments, along with allowing you to allocate people to your “friends” group, which in turn will allow them to post entries on your blog.
Chapter 6: Content Aggregation – This chapter primarily describes how to use one MODx snippet, “Ditto.” Ditto allows you to pull lists of content from other areas of the site into your pages and/or your templates, allowing you to do things like latest posts listings, or latest comments. It also goes on to introduce how to use Ditto to output RSS feeds, JSON and XML documents. It then briefly introduces the concept of extending snippets to add extra functionality without duplicating existing code.
Chapter 7: Creating Lists - Much like the Content Aggregation chapter above, this one focusses on the use of one snippet. This time, it’s how to use the WayFinder snippet to create hierarchical lists of content on your site, for use as menus. It then discusses how to style them to better suit their job as a menu. The chapter is mostly HTML and CSS sample code, along with screenshots, and doesn’t really go into a great deal of detail.
Chapter 8: Snippets - In a bit of an odd twist, the book begins to introduce snippets themselves here. We’ve used them several times already, but this chapter explains what they are, how they work and how you use them. It does so by explaining how to set up and configure a user-commenting snippet called Jot. Once again, this chapter is incredibly example-code heavy, which may be frustrating if you’re not reading the book to create the sample site it covers.
After having done this, you’ll be shown how to download and install a snippet, which again feels a bit late, but not as late as the wrap-up, which tells you how to find snippets online.
Chapter 9: PHx - Another puzzling chapter ensues, this time discussing a feature called PHx. It’s a way of doing conditional logic in your MODx templates, something I assumed was part of the template engine by default, but apparently it is not. PHx is actually a plug-in that is not included by default. After a brief guide to installing the plugin, the reader is treated to another long and unrelated example, before being shown how to actually use the PHx syntax, which is just as amusing as the template variables were.
Chapter 10: Simple Recipes – When I first read the title for this chapter, I assumed it was going to be a summarisation of what you’d been taught already, by means of building a simple recipes site. I was wrong. The chapter was instead a guide to installing, configuring and using a few of the author’s favourite MODx snippets. Some of them useful, one of them was entirely separate software package for running a forum (SMF) and how to integrate it.
Chapter 11: Creating Snippets - We’ve been learning about what snippets are, and how to use them, for the majority of this book. This chapter gives us an outline of how to create them. You’re taught the obligatory “Hello World” example in detail, initially using the simplest method possible, and then later using more complex MODx-like methods. The chapter is a good guide, giving examples that are useful, as well as diagrams explaining how MODx processes snippets. From a developer’s perspective, this is actually very useful.
The end of the chapter gives you a brief introduction to the MODx API, and it’s database abstraction layer. As with an earlier chapter in the book, this is well written – but as a result serves to highlight some curiosities in MODx itself. Their database layer provides an intriguing method for building queries, in which you pass all of the usual elements of a query in as parameters. It’s like a poor man’s SQL, as it doesn’t implement any of the features as well as SQL itself, but enough that it isn’t going to work properly across database platforms. Not the fault of the book, but an interesting thing to note none the less.
Chapter 12: SEO, Deployment and Security - When I first received this book, one of the first bits I read was this chapter. It irritated me immediately. This book serves as a good guide for new web masters trying to set up their first MODx site, and that’s where it should have stopped, in my opinion. The SEO section is full of faults, inaccuracies and doesn’t go into enough detail on any one section to actually be useful. There are a few small nuggets of useful information, but to call this section SEO guidance is wrong. If I were editing this book, I’d rather have seen a list of external resources that would be useful for this topic, than a non-expert trying to cover it.
The deployment section is much the same, whilst it’s more factually accurate, it doesn’t cover anything in enough detail to be useful. I’d like to have seen web addresses for a selection of popular FTP clients and their documentation. The reader does not need to be confused with guides to FTP, SFTP and WebDAV.
Finally, the security section. This is a lot better, it gives a brief and concise primer to securing your MODx installation, which I’d imagine will help keep new web masters a little safer.
Chapter 13: Plug-ins and Modules - This section of the book gives you a detailed guide to installing, using and eventually creating plug-ins and modules for MODx. Plugins seem to be collections of hooks (or “events” in MODx lingo) that execute at certain stages of the execution flow, and as with other development focussed areas of this book, the chapter gives you a good introduction to how to create them. You’re also given a couple of useful real world examples to get you on your way.
Summary
So, to the summary. All in all, as much as my review has not been amazingly positive, this is not a bad book. I’m sure it’s a great guide for a beginner web master, setting up their first MODx site or for a new MODx modification author, looking to get started. There are a number of flaws and inaccuracies along the way, but it covers most things someone wanting to get into MODx would want to find.
It’s definitely not a reference book, however. It’s also definitely not for professional web developers. As someone getting started, you’ll work through this book once or twice and by the time you’re done you’ll have an understanding of how to work with the system, but that’s where it’s usefulness comes to an end. For a typical web developer like myself, a reference book would be a much more useful publication, one that can be picked up and dipped into over and over again that details every part of the system with no frills or commentary.






I’m a big MODx fan, and I could take issue with some of your opinions about the MODx CMS/F itself, but I won’t, since this is a review of the book and not of the CMS/F.
That said, let me say wholeheartedly that I completely agree with your review of the book. I found it wholly confusing even for a complete beginner.
thanks for an honest review, finally!!
a MODx fan