What can you do with inner blocks in Gutenberg?

What can you do with inner blocks in Gutenberg?

Inner Blocks are Gutenberg Blocks that allow inserting additional blocks within your own block. To understand it even better, imagine a shortcode that wraps the content. This content can then be shown or hidden. You can achieve that inside Gutenberg with Inner Blocks.

How to create nested blocks using innerblocks?

Nested Blocks: Using InnerBlocks Edit You can create a single block that nests other blocks using the InnerBlocks component. This is used in the Columns block, Social Links block, or any block you want to contain other blocks. Note: A single block can only contain one InnerBlock component.

How are innerblocks used in a post template?

The InnerBlocks template is for the component in the single block that you created, the rest of the post can include any blocks the user likes. Using a post template, can lock the entire post to just the template you define. A common pattern for using InnerBlocks is to create a custom block that will be included only in the InnerBlocks.

When to use the orientation prop in innerblocks?

By default, InnerBlocks expects its blocks to be shown in a vertical list. A valid use-case is to style InnerBlocks to appear horizontally. When blocks are styled in such a way, the orientation prop can be used to indicate a horizontal layout: 1

Can you save custom markup in Gutenberg editor?

These aren’t blocks I would recommend for production. But you can fork and fiddle with them to learn. This one is API Block. Now that we’ve gone over how the edit and save functions work with the new Gutenberg editor, we know that it’s easy to save custom markup for our block.

What does the serversiderender do in Gutenberg editor?

One of the newer features of Gutenberg (since 2.8) is the addition of the component that simplified creating the editor representation for dynamic blocks. This component allows the editor to render the block based on the PHP render_callback function.

What’s the newest feature of the Gutenberg editor?

Rather than break that down I’ve added comments to the code to explain what each portion of the code is doing. One of the newer features of Gutenberg (since 2.8) is the addition of the component that simplified creating the editor representation for dynamic blocks.