Gutenberg 3.9 Introduces Reusable, Exportable Templates for Multiple Blocks

Gutenberg 3.9 was released last week with a new feature that allows users to group multiple blocks into reusable templates. The templates can also be exported and imported as a JSON file.

The idea of reusable templates is an expansion of the concept of dynamic reusable blocks that Gutenberg technical lead Matias Ventura proposed in June 2017. Reusability is even more powerful when applied to multiple blocks. The import/export capabilities make it possible for templates to be easily shared across WordPress sites.

If you want to test it, you can select multiple blocks by selecting the content inside a block and dragging outside the boundaries of the block to extend the selection to multiple blocks. The multi-select feature was originally added for the purpose of deleting or moving multiple blocks but it has now become indispensable for creating reusable templates.

This feature lays the ground work for a full-fledged layout builder in the next phase of Gutenberg development. Reusable templates should make it a breeze to build WordPress sites with pre-defined layouts that users and developers can share. They are much more intuitive to implement than page templates.

“Holy wow, imagine this: wp-blueprints.com, where people can group blocks together and share their JSON strings with nice little copy buttons,” Gutenberg designer Joen Asmussen commented on the PR. “Categories for top rated, most downloaded, search, etc? This is going to happen because of this magic.”

Matias Ventura’s demo video shows the reusable templates in action. It also highlights a new tool for visually comparing possible ways to convert an invalid block. The editor now includes a diff UI for blocks, which Ventura said could possibly scale in the future to provide an improved UX for revisions as a whole.

A few other notable additions in the 3.9 release include improvements to the drag and drop handle, collapsible groups for the block toolbar, and the ability to convert a cover image block to an image and back. Dark editor style support is now available for theme developers, making Gutenberg more friendly for use with dark WordPress themes. Check out the 3.9 changelog to see a full list of enhancements and bug fixes.

12

12 responses to “Gutenberg 3.9 Introduces Reusable, Exportable Templates for Multiple Blocks”

    • So does Divi, Beaver Builder, Thrive Architect, Elementor, Visual Composer and many other PageBuilder tools deliver now reusable templates Gutenberg is late to the game and still does not have the facilities for managing and display, and globalizing templates that many of the PageBuilders have.

      It seems that WordPress is devoting so much effort to duplicating functionality that is already available and then according Gutenberg the reward for being late – it goes core and gets all the associated privileges of core.

      This programming duplication effort could be better spent on going to the Cloud, supporting Kubernetes, Elastic Search, Kafka, and other messaging and data transfer protocols much more functional and robust than the RestAPI 2.

      For WordPress to become the Web’s Operating System – or even Frontend – it must embrace the cloud, containers, and messaging with robust data interchange that is currently fast emerging. I was at AWS, Microsoft Azure and most recently Google Cloud Platform, and WordPress was treated as an afterthought by all three principle forgers of the Webs future.

  1. True. And in light of that fact that this was the intention, in the face of criticisms at what Gutenberg lacks compared to the current editor and all the the bugs extant, you would wonder.

    I keep returning to test Gutenberg on each new release and all I see is the same bugs/bad implementation. Two things. Terrible buggy implementation of metaboxes and whether you can arrange them below the content or in the sidebar. If one or the other areas are empty, you can’t move a box to those empty locations, no way José. And, if you load the editor and then attempt to leave, having not made any changes, you are asked to update.

    Other than that revisiting Gutenberg with updates has the sense of rearranging the deckchairs on the Titanic.

    Gutenberg, some nice ideas, looks nice, but underneath very clunky, clumsy and badly implemented…not very useful. To boot, wildly surpassed by many, many page builders already on the market.

  2. “Template” might be a misleading term. Reusable blocks are more text snippets, more like reusable content with fixed layout.

    If you reuse a block, like a call-to-action button 30 times around your site and for 31st time you change the URL – the change will propagate over all previous instances of your block.

    There is a step in between to prevent this: Convert the reusable block to stand-alone-block first, before making an unwanted change.

    Block Templates with placeholder content are still reserved for Custom Blocks

  3. I am going to ask a question as a non-developer, perhaps as a typical user of Gutenberg when it reaches core.

    At the moment, Gutenberg is a plugin. A few people, Mike McAllister and Danny Cooper to name two, have made additional blocks that are available as plugins.

    When Gutenberg goes into core, I will want to use some additional blocks (pricing tables from Danny Cooper would be an example).

    If that block is in a collection of blocks available as a plugin I could add the plugin.

    I could then end up with many plugins, really only wanting just one or two blocks from each plugin, and perhaps lots of repetition because the different plugins cover a lot of the same ground.

    In an ideal world, I don’t want extra plugins on my site if they don’t need to be.

    Is there a way I could extract the blocks I want, keep them and remove the plugin? Would reusable templates enable me to do this?

    Is there a different way to do it? Will there be a repository of just blocks and only blocks that can be exported to a site without the need to add a plugin at all?

    • Is there a way I could extract the blocks I want, keep them and remove the plugin? Would reusable templates enable me to do this?

      Technically yes. However, it would require a bit of programming chops and knowing what you need from the plugin to make the specific block(s) that you want work. On top of that, you’d still need to add it to a plugin of some sort so WordPress still runs the code.

      Reusable templates only work when the code is there to run.

      Generally speaking, it would just be easier to keep the plugin intact. That way, you also get any future updates, improvements, or enhancements.

Newsletter

Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.