Introducing Blocks

Perch and Perch Runway 2.8 will include a new feature called Blocks. Blocks attempts to balance the control of structured content and the flexibility of WYSIWYG.


It’s a common problem. You want to use the powerful content templates that Perch offers in order to capture structured, reusable content, but you also want to give the client freedom to go nuts on more free-form pages with text and media. Up until now the answer has been to use a WYSIWYG editor and embed the media in that.

This is a really unsatisfactory solution, as it means that your images and such are bound up in the messy HTML the WYSIWYG outputs, and not easy to reuse. If you wanted to output that content in a different form – without the images, for example – it would be very difficult and fiddly to do.

Blocks in Perch 2.8 are an answer to that problem. Blocks offer the content editor a choice of what type of content to add next. They can add some text, then an image, then maybe a pull quote or some more text, and then reorder them. These aren’t just single fields, however. Each block is a solid, structured micro-template, and can include lots of field types, repeaters, and any mark-up you need. They’re regular Perch templates, but the editor can pick which they want next.

A template (for a content or collection item, say) can include a perch:blocks region that defines the blocks. It can include other fields outside of the blocks, too. Take a look at the template used in the video to see how it works.

Blocks are a new feature coming in Perch and Perch Runway 2.8.