My all-time favorite layout block suite for the block editor is GenerateBlocks. There’s very little you can’t do with this block suite, so I decided to release a few tweaks (hacks?) that enhance the existing block plugin. The result is GB Hacks.
Let’s dive in and see what this new add-on is all about.
New Pattern Importer block
Pasting in block patterns in the block editor can be a confusing process. Not always is the pattern parsed in the same format, and pasting in patterns doesn’t pull the images over and instead links to the original hosted image.
This is where the Pattern Importer comes in. You paste your pattern code in, and it will download all of the images to your site so that the images are local.
In addition, it’ll replace any unique IDs generated by GenerateBlocks so that the pattern won’t have any conflicting style rules.
Set the Headline block as the default block
The Headline block is versatile; now you can set it as the default to be used in the block editor.
You can also set the default HTML element that is used, so you can replace the Paragraph block with the Headline block.
Wrap multiple blocks with a Container block
Have you ever selected multiple blocks and wanted to wrap them in the Container block? You now can.
Within the selection’s context menu, you can choose to wrap the selected blocks in a Container block.
Convert a Group block to a Container block
I was surprised to find out that the Group block doesn’t already have a transform to a Container, so I decided to add it in.
Take any Group block with child elements and replace the Group block with a Container block instead.
Other notable features
Other notable features include:
- Add Adobe Fonts to the typography dropdown (supports the Custom Adobe Fonts plugin)
- Select which post types should have extra style compatibility with GenerateBlocks
- Use the Command Palette in the block editor for some GenerateBlocks shortcuts to its settings
- Generate new Unique IDs for a parent block and its children
The future of GB Hacks
I did an initial release a week ago and the plugin has proven to be popular and the reception quite positive. For this plugin, I’ll be relying on the users to move this plugin forward as far as feature requests.