How to allow core Gutenberg blocks selection only when you are inside a custom inner block

Question

By adding a new post, we have access to all core blocks from the very beginning. I would like to limit this and prevent some core blocks from being used on the main level. They should only be available inside my custom inner block.

I have been given some advice about:

  • using the template with init action
  • using the parent attribute in custom block

but all this does not limit the availability of blocks at the main level

I figured maybe hiding blocks, depending on where the inserter is in the DOM structure might be an idea but I’m not sure it’s a good direction.

0
kanlukasz 3 months 0 Answers 16 views 0

Leave an answer