by Ben on 27th March 2018
I’ve been a little confused by the CMS space for many years so I thought I'd take a look what's happening in this space to solve the all too common problems we face on daily basis.
As a PHP developer I’ve never really warmed to the idea of being forced to develop on platforms such as Wordpress or Drupal, which is one reason I loved discovering Perch CMS early on in my journey. The idea of region-based content, that you can drop into an existing site just made sense to me and it meant I could use my PHP framework of choice to deliver the site or application.
But start to look at more complex content workflows and even Perch CMS starts to feel a little out of its depth (although no more so than Wordpress or Drupal). Managing content between different staging environments and trying to keep things organised in larger teams started to become a time-consuming and frustrating task.
Now, API-based, headless CMSs have been about for a number of years, however the stronghold that Wordpress and Drupal have on the CMS world is a difficult one to break through. I’ve read articles from developers who have resorted to simply using Wordpress itself as a headless CMS, but often this was to allow a modern framework to be used alongside an existing Wordpress setup.
So, with the task of redeveloping our company website coming up on the backlog I thought I’d take a look at what was available in terms of API-based, headless CMSs.
All three take a similar approach to content modelling, so after that it really came down to the user interface and features. I’m not going to go into a full comparison of them all, but I will elaborate on a few of the features I particularly like about the one we chose, which was Prismic.
From the second I logged in, it just felt right. Everything seemed to feel intuitive and in the right place. I love the clean, simple screens for adding new content types and the content edit screens aren’t cluttered with a bunch of options. All-in-all it felt well thought out and easy to use and understand.
I really like the release feature in Prismic. This solves a problem I’ve seen many times, whereby a team needs to coordinate multiple changes across a wide range of content and release those changes all at the same time. This is made super easy to do and even allows users to preview the release before publishing it.
The way that Prismic has approached Previewing is perfect. It essentially allows you to link to any of your site environments, but in ‘Preview Mode’. Giving the user the ability to see their new content actually in the website is such a great feature. And from a developer perspective, they do all the heavy lifting for you by managing the preview session in the SDK.
Since Prismic stores each piece of released content as an immutable document, you have easy access to every single version that has ever been published. The UI for navigating this is really simple to use and almost feels like using Google Docs. I also love how it shows the diffs between each version in a combined view, again very much like Google Docs.
A feature I just love about all API-driven CMSs is the fact that the content is managed independently from the application environments. This completely removes the headache of trying to keep the content on Local, Test, Acceptance and Production environments in sync with each other. This is probably one of the biggest issues we’ve faced in the past with traditional CMSs.
If you look into it, the architecture behind the content API really is quite clever. They have caching pre-built into the API at their end and make it really easy for you as the developer to add caching on the client end.
As Laravel developers we were able to get up and running with their PHP Starter Kit really easily. Simply pull it in using Composer and you’re ready to go!
The code syntax for retrieving and traversing the API data is not as ‘fluid’ as I’m used to in Laravel, however it’s not terrible and it’s pretty easy to get to grips with.
UPDATE: The syntax has been hugely improved in API v2.
Prismic allows you to create basic relationships between different documents as part of its content modelling. This is great for creating hierarchical page structures or reducing duplication of content e.g. linking to an Author model on a Blog post instead of storing author details against the Blog post itself.
Prismic have an API interface for each repository that allows you to try out your queries in real-time and see both an HTML and JSON response. This is great for trying things out without having to write the queries into code. Once you’ve got your query sorted you can easily copy it into the PHP syntax, since it all uses the same query language.
The only two slight snags I have with Prismic are:
It would be nice to be able to make certain fields within a content type ‘required’, however this is not a deal breaker for me, given that you can preview your content before publishing it.
It would be nice to get more granular information about what has changed, rather than just being pointed to the masterRef for the release that was affected. It is possible to query the API to find out more, but to me it just feels like this should be included in the webhook payload by default.
I did speak to Prismic about these snags and whilst they couldn’t give me any fixed timescales for addressing these issues, they assured me that they release improvements on a daily basis and do have a development workflow for considering feature requests.
As a developer I feel that API-based, headless CMSs like Prismic empower me to build websites and applications using the framework, libraries and tools that suit me. I also feel that the content modelling is a great lynchpin for developers and content editors to collaborate around. Overall, I love that Prismic (and other API-based, headless CMSs) cater for both types of user, focussing on simple editing tools and powerful workflow features for content editors and a JSON API and webhooks for developers. Things are definitely starting to look better!
Thanks for reading, I’d be interested in hearing from any content editors (or other developers) who have used Prismic or other API-based, headless CMSs. Feel free to tweet me @bgurney
If you’re interested in reading more about Prismic, I’d recommend checking out this blog post for more about where they see things heading in the future. I think it sounds exciting!
If you enjoyed this blog post and you’re interested in working with us, drop us a message and we’d be happy to have a chat.