First Impressions of Using Modx

My wife, Erin, is doing some marketing work for KTF Consultanting.  Part of the overall marketing plan was to make some small changes to his website.  Being the samurai developer that I am, she recruited me for those "small changes".  I was happy to help.  I looked over what she wanted, which amounted to adding in his blog feed, add a few UI elements, and a graphic here and there.  Based upon the number of pages and simplicity of the site I assumed that the original developer just stuck with static HTML or maybe PHP to utilize includes.

I was wrong.  The site is actually powered by MODx.  What I thought was going to take me a few hours just took a completely different turn.  I wasn't too worried considering I have worked with a wide variety of CMS' in the past. I was pretty confident that if MODx was worth it's salt then I should be able to knock out what I had to.  In the end I was right.  Though MODx wouldn't be my first choice for a CMS it certainly has it's strengths and I would recommend it to any one as an option.  Creating/editing the content was easy and I didn't even have to consult their documentation.  Granted I didn't go through the install process, but if I did reference that in the documentation out of curiosity and it didn't seem too complicated.

One of only frustrations that I had is how MODx treats their templates.  In this particular instance, the template/theme was stored in the database.  In order to edit the template I had to login to the management console and edit the template inside of a large textarea.  I was very confused when I first saw this because I couldn't tell if the developers of MODx where trying to treat the template as a model or had some other "geek reason".   Almost immediately after tweeting about my confusion I received a response back from one of their community developers who stated:

"The template is a view structure. There is nothing about MVC that requires views be stored in the FS. You can have templates in FS. Templates can be considered a managed content type as can documents that can also be used for views too.  MODx templates are a data record which doesn't make it part of a model. It is referenced via controller just as a FS record.  I understand that you prefer to have your templates on the FS. MODx won't limit you to db based templates."  @jaygilmore

While his statement is correct, there is NOTHING in MVC that requires views to be stored on the file system, using the database to store the template isn't practical.  You can steer your car while driving with your feet, but it doesn't make it a good idea.  There are a few fundamental issues that I had with keeping your templates in the database.  What happens if the database crashes.  I am sure that the templates are cached on the file system, so that each request for a page doesn't require a call the database, but if/when that cache expires then your site is HOSED.  In addition, if indeed the template is cached on the file system then why even bother with keeping it in the database.  Bypass that all together and keep all views/templates on the file system.  Finally, there is the creation/maintenance of the views/templates issue.  In most scenarios that I have worked in either with a company or freelance the template/design side of the site is usually handled by a designer...as it should be.  Designers shouldn't, and most don't know how to, edit/create templates from the database or backend management system.  They want to be able to, wait for it...create/edit on the file system.  That is what is intuitive and the most efficient.

I will summarize by saying that I did read where you can keep your templates on the file system with MODx, but unfortunately it is not straightforward and what I can tell not what is encouraged.  If there is better documentation out there on the subject then please let me know.  Overall, I really liked working with MODx.  There are many aspects that it does very well and they far outweigh those that they don't.  No CMS is going to do everything that you want.  Most get you 80% of the way there and it is up to the samurias of the internet knock out that remaining 20%.

MODx CMS Hompage: http://modxcms.com/
3 responses
Recently I've been evaluating a number of CMSs, and I'm looking at MODX right now. I found this post while trying to figure out how to make templates live on the filesystem, and I'm coming to the same conclusion you have—you're not really supposed to.

I find this behaviour bizarre, and it's not just MODX which does this. ExpressionEngine 2 stores templates only in the database by default. While there's a way to push them back to the filesystem there, they have to remain editable from the backend, which requires them to be writable by the webserver.

What about revision control? What about multiple people working on the same web project simultaneously? What about using a text editor with features instead of a textarea in a browser?

It seems a very strange choice.

Gavin you are spot on.
I actually got some feedback from a MODx developer and at the end of the conversation we just had to agree to disagree.
Very strange indeed.  I haven't had to use it since and would not recommend it to anyone.

I also found this post while searching for a solution how to make templates live in the filesystem. I used MODx for a couple of projects, but not beeing able to edit the templates and chunks with my favorite editor and not having version control drives me nuts.
There is a package called MODXFS-PHP, which mounts the database through FUSE in the filesystem. It works locally, but gets very complicated if you want to use FUSE across your local network with samba or AFP or via SSHFS. With MODXFS-PHP you also have to be extremely cautious, what you do, because every change and every file gets posted to the database. So, if you are using a Mac to edit your files, you will quickly fill your database with .AppleDouble entries and so on. This is not a solution.
I guess, I have to change my favorite CMS again.