Longform Content material with Craft Matrix – A Checklist Aside

Article Continues Under

Jason Santa Maria just lately shared some ideas about pacing content material, and my developer mind couldn’t assist however take into consideration how I’d go about constructing the examples he talked about.

The one fool-proof technique to obtain closely art-directed layouts like these is to jot down the HTML by hand. The issue is that content material managers are usually not at all times builders, and the code can get advanced fairly rapidly. That’s why we use content material administration programs—to provide content material managers simpler and extra highly effective management over content material.

There’s a continuing rigidity between that sort of longform, art-directed content material and content material administration programs, although. It’s powerful to wrangle such distinctive layouts and types right into a standardized CMS that scales over time.

For some time, the very best we may do was a collection of customized fields and a giant WYSIWYG editor for the physique copy. Whereas nice for content material entry, WYSIWYG editors lack the management builders have to output the semantic and clear HTML that make the good experiences and delightful layouts we’re tasked with constructing.

This rigidity leaves builders like myself on the lookout for alternative ways to handle content material. My consideration just lately has been targeted on Craft, a brand new CMS that’s simply over a 12 months previous.

Craft’s answer for longform content material is the Matrix subject. With Matrix, builders have the flexibleness to offer customized fields for use for content material entry, and might write customized templates (utilizing Twig, in Craft’s case) for use to render that content material.

A Matrix subject is made up of blocks, and every block sort is made up of fields—something from textual content inputs, to wealthy textual content, dropdowns, photos, tables, and extra. Right here’s what a typical Matrix setup appears to be like like:

Configuring a Matrix field

As a substitute of combating with a WYSIWYG editor, content material managers select block sorts so as to add to the longform content material space, fill out the offered fields, and the content material is rendered superbly utilizing the handcrafted HTML written by builders. I take advantage of the Matrix subject to drive longform content material alone website, and you may see how a lot flexibility it offers me to create attention-grabbing layouts crammed with photos with captions, quotes with citations, and extra.

To drag again the curtain a bit, right here’s how my weblog submit Unsung Success is entered into the Matrix subject:

Entering Content with the Matrix field

Three block sorts are used within the submit seen above—a picture block, a quote block, and a textual content block. Discover that the textual content block is utilizing a WYSIWYG editor for textual content formatting—they’re nonetheless good for some issues!

The Matrix subject is endlessly customizable, and offers the extent of flexibility, management, and energy that’s wanted to realize well-paced, art-directed longform content material just like the examples Jason shared. This can be a large first step past WYSIWYG editors and customized fields, and as we see extra superbly designed longform items, our instruments will solely get higher.

Leave a Comment