Live component guide: Part 1 — Drupal Paragraphs
The making of Acro Media’s website content creation framework
It’s commonplace for brands to create guides so that there is a constant standard to follow when working with the brand’s identity. These are generally called style guides. We have one ourselves that we use when designing internal documents and printed layouts. This is great when it comes to branding, but how do you go about maintaining a level of consistency for something larger, such as a website? We recently underwent a fundamental shift in the way we create our website content, and with it, the Live Website Component Guide was born.
The content-type crux
For those familiar with Drupal, creating something called a Content Type is a common way to go about setting up a type of content — think your standard web page, blog post, frequently asked questions, rich media slider, etc. That content type can then be used to generate the pages of your website.
This works well enough if your site doesn’t need to change, but our marketing team is constantly looking to adapt to new trends, change content layouts, and A/B tests. A website should ideally be dynamic and quick to change, however, changes ended up taking a lot of time because they need to first be designed and then built. The standard Drupal content type is rigid and the layout is fixed, so if you want to change the layout, the change is going to cascade to any page that uses that content type. Because of this, we often needed to create a whole new content type, template and styling. Something that should be quick ends up taking weeks because our process just wasn’t efficient. And furthermore, the more code we introduced, the more difficult the site was to maintain.
In February of 2017, we had a “eureka” moment while attending the Pacific Northwest Drupal Summit in Vancouver, BC, Canada. Here we learned about a new (to us) content creation module called Paragraphs. I know many people have been using this module for a while now, but it was new to us and we immediately saw the potential. As stated on the Paragraphs module’s Drupal.org project page:
“Paragraphs is the new way of content creation! It allows you — Site Builders — to make things cleaner so that you can give more editing power to your end-users.”
And it DOES do that! Instead of thinking in ‘pages’, we can now think in ‘components’. The graphic below illustrates this. On the left, is a representation of a standard Drupal page layout using a Content Type. On the right, the same page is broken out into individual Paragraphs components.
Content Type vs Paragraphs
What this module allowed us to do is to remove the rigid structure of the Content Type and instead build out a set of individual, standalone components that can then be inserted into a page wherever we want. If we want to add a new component to a page, we just select the component from a list and place it on the page. To remove one, we just click a remove button. To change the order, we need to drag and drop the component where we want it. If there is a component that we need but doesn’t yet exist, we can now create just that one component. It makes things fast!
The content creation aspect is incredibly dynamic and easy to use. The best part of all is that once the components are built, the only need for a developer is to create new components later on. The actual content creation can easily be done by anyone with a very small bit of training.
From a design point of view, our designers can now piece a layout together knowing exactly what components are available to them. They know that if we’re missing a component, they can come up with something new and it’s not going to take weeks to implement. Plus, we already loosely follow the Atomic Design methodology by Brad Frost, so the whole concept was easy for them to grasp and got them excited. In fact, our Creative Director jumped on this concept and we now include a full set of content creation Paragraphs components in every new project that we build.
An example of how easily we can generate page layouts using component-driven design.
Things get very easy from a code maintenance point of view too! We created each of our components to have a standalone template and styling. This means that things stay consistent throughout the site no matter how a page has been set up. If we need to make a visual change to a component, we make it once and the change cascades throughout the site. The codebase is small and logical. Anyone new to the project can jump in and get up to speed quickly.
Our live website component guide
So, if you’ve read this far, I bet you want to see it in action? You’re in luck! I recorded a quick video that shows you how it works using our corporate website’s Live Website Component Guide. You can watch the video below or view the page in all its glory.
UPDATE: Part 2 of this post is now available showing a Drupal 8 live component guide.