Experimenting With Reusable Blocks to Create Post Templates
For the past several years, I’ve used the Post Template plugin developed by Vincent Prat to create and manage post templates. For example, some of the information in the WordPress Weekly and In Case You Missed It posts never changes and instead of manually entering it each time, it’s nice to use a template where only a few changes are necessary.
The other day, I was wondering if I could use the reusable block feature in Gutenberg to replace the plugin. Justin Tadlock reached out and provided me a reusable block template JSON file that I imported into Gutenberg. By the way, if you successfully import a block into WordPress, the block won’t appear until you manually refresh the page.
The reusable block template approach works fairly well. However, I noticed that I was unable to add a block inside the reusable block. When I tried, a red line was displayed and any blocks that were inserted were removed.
Red Means No
I understand that reusable blocks are meant to be restricted templates where changes are distributed across a site to wherever the block is displayed. But it’s still a bummer that I can’t add a block inside the template for a singular purpose if a need arises.
One other thing I noticed is that reusable blocks are custom post types. While there is a link to manage them within the reusable block selector, there isn’t a dedicated item within the admin menu. Unless you know the location of the management link, adding and managing them can be a bit more time-consuming.
If you want a quick shortcut to the reusable block management screen, add this to the URL after your domain name. wp-admin/edit.php?post_type=wp_block
I think I’ll experiment with reusable blocks a bit more but as long as they’re not changing often, I believe they’ll make a nice replacement for the Post Templates plugin. What use cases have you encountered where reusable blocks were the solution?