I’ve just completed my second project using MODX so I thought it would be a good to time to write up my thoughts. I get the impression that MODX is largely unheard of in the industry so I’m writing this post partly to spread the word.
What is MODX?
MODX is a open source content management system. It’s built using PHP and MySQL so it’ll run on pretty much any web server. Much like WordPress, there are two versions: MODX Revolution (think wordpress.org; a downloadable version that you can install on your own server) and MODX Cloud (think wordpress.com).
MODX is unassuming: it doesn’t care where templates are, or how they’re organised, or where content is placed. It’s a flexible system that allows you to work the way you want.
Where does MODX fit in?
There are plenty of good CMS’s out there. In the past, I’ve used WordPress, Perch, Expression Engine, and Kirby as well as Shopify and Magento for eCommerce. I use WordPress and Perch on a regular basis and both have proved to be reliable and easy to use for clients.
Which begs the question: why should you consider MODX?
Having used WordPress to build everything from blogs, to 5 page websites, to multi-region websites with 100s of pages, it’s fair to say I know WordPress pretty well. I’ve come across many hurdles when building large WordPress sites: in particular, the permalink structure and taxonomies can be restrictive. It’s improved a lot over recent years however it still doesn’t feel like the right tool for the job when it comes to large, complex websites.
This is where MODX shines. While WordPress assumes a structure (custom post types, taxonomies, themes), MODX is an empty shell ready for you to build as you please.
The way that MODX handles templates is refreshing. You don’t need to create templates with certain file names or place them in a particular folder and the MODX syntax ensures code is clean and readable.
I’m coming from a WordPress background. Will it be hard to learn?
There is a small learning curve.
Firstly, MODX uses different terminology. MODX has the following parts:
Resources - web pages (although resources can be documents, web links, etc.)
Templates
Template variables - equivalent to WordPress custom fields
Chunks - reusable HTML markup (i.e. headers, footers, sidebars, etc.)
Snippets - dynamic bits of PHP code
Plugins - similar to snippets but are triggered by system events
Secondly, MODX uses its own tag syntax. At first, I couldn’t understand why the team behind MODX would go to the hassle of creating their own syntax but after using it for a while it makes sense. It keeps template code clean and it’s easy to read (and it’s way better than those ugly, inconsistent WordPress functions).
How does it work with Git?
My team didn’t have any problems in the last project. We used this .gitignore file to ignore everything except assets and core files.
There are no file paths stored in the database so it’s easy to move databases across development environments.
Any downsides to using MODX?
As mentioned in this post, there’s is a slight learning curve involved. It’ll take a while to become fully accustomed to the terminology and the MODX way of doing things.
While the documentation is pretty good, trying to find answers to problems you’ll come across can be tricky. Chances are if you’ve had a problem in WordPress, someone will have posted a question on StackOverflow or WordPress Development Stack Exchange (probably multiple times). The MODX community is smaller, so you’ll have to search a little harder.
That said, I’ve found the community on Twitter to be very helpful. I’ve tweeted a number of questions using the #MODX hash tag and every time I’ve had at least one reply that has pointed me in the right direction.
Setting up MODX is more time consuming than WordPress. For example, to get it working on my local machine I cloned our repository, then copied in the MODX files, then had to play with config files, run the setup, fix some file permissions and run the setup again. Compared to WordPress, getting MODX up and running is a little long winded.
Final remarks
While I’m still new to MODX and have plenty to learn, I finally feel like I’ve found a solid and reliable CMS that offers me the flexibility that I need. I wouldn’t hesitate to recommend it to businesses wanting to run large websites with hundreds of pages. I’m already looking forward to digging into my next MODX project…