Fraser Boag

Catching the Craft bug

Back to all notes
15th June '20

Craft has been a popular choice of CMS for a while now, particularly for client work in agencies due its lightweight nature and total flexibility. My relationship with it has been a bit turbulent, mostly due to professionally inheriting a batch of Craft Commerce websites which weren't especially well built, hadn't been maintained, and are hosted on a sub-optimal server.

Due to my own short sightedness I internally blamed the misgivings of these particular websites on Craft and never really took it seriously as a platform. Last week, however, I was investigating some options for a new client project with somewhat unusual and specific requirements - I spun up a clean instance of Craft + Commerce and was blown away by how quickly I was able to get a basic working concept up and running, entirely using Craft's default settings - no bloat, no plugins, no hacks - it felt like anything was possible.

Since then, I've been hooked. I watched through a couple of tutorial series on Craft Quest to better familiarise myself with some of the core features, and then spent a bunch of free time over the last few days completely rebuilding the back end of my personal website (the one you're looking at right now) to run on Craft, including building a custom plugin to handle Mailchimp sign ups.

Until now, Wordpress would have been my go-to choice for brochure sites and similar - and I still maintain it's a much better CMS than much of the development community gives it credit for (when used responsibly) - however by comparison there are a number of aspects of Craft which have so thoroughly charmed me over the last few days that it'll probably come to hand a lot more readily in future.

It feels as much like an MVC framework as a CMS

Working with Craft over the last few days has reminded me more of building a Symfony or Laravel application than coding a theme for another CMS. This isn't surprising given it prides itself on being a relatively thin layer on top of Yii 2, but it's a real breath of fresh air.

A small, but crucial, part of this is its use of a .env file by default, making portability between different environments an absolute breeze.

It makes no assumptions about your project

A frequent criticism thrown at WordPress is that it's blogging software by default. While this is easily solved with the likes of ACF Pro, no amount of plugins will undo the sheer bulk of pre-configuration you're committing to with a new WordPress website. I mean things like specific Post Types being set up for you, Comments being enabled by default, and so on.

I used to like this - it meant you could get up and running really quickly - but as I mature as a developer and yearn ever more to understand my projects holistically and give my projects exactly what they need and no more I'm starting to see the downsides of this approach.

Craft assumes nothing - a fresh install has no Sections, no Fields, no Categories - nothing except the tools to create these things as you see fit. Out of the box, a "Blog Post" section which you create could have 1 field or 100, it doesn't matter.

It's Multi Site by Default

Not something that comes up all that often personally, but when it does it can be a real headache. With Craft, every site has full multi-site capabilities straight out of the box. Even if you're only building a single website, it's automatically part of the "Sites" data structure - so if another language, or a sister brand needs to be added down the line it's just a case of adding it. You don't need to undo your work to that point or re-engineer your entire application.

Further to that, Sites are surfaced everywhere throughout the Control Panel, allowing you to easily do things like enable different content and serve different templates to different Sites, while managing all of this through one Control Panel.

Composer and Twig are just great

Craft sensibily stands on the shoulders of giants and uses a host of other technologies behind the scenes, mostly without abstracting them away. By doing this we, as developers, gain more widely useful skills and also benefit from a world of pre-existing documentation.

Composer and Twig are far from the only examples of this - I just really enjoy their appearance here.

Convinced? You can check out Craft CMS properly over on their official website.

More notesAll notes

Get in touch  —
Copyright © Fraser Boag 2013 - 2024. All rights reserved.