I have created a custom block with innerBlocks, let's call it parent block. I only allow for one kind of block inside that block, let's call it child block using the "allowedBlocks". The simple use-case is when a user wants to add the child block inside the parent block, then it all works fine.
Now here is the problem:
Sometimes one would need to be able to add multiple child blocks inside the parent block next to each other. For that I would love to use the core/colums block from gutenberg. The problem is, that inside that core/colums block I also only want to be able to add the child block and no other.
Is there a way to set allowedBlocks for a block inside allowedBlocks? Is there some 'global' way of saying: "all blocks inside of this block can only be one of [..., ..., ...]?"
edit: function( props ) {
return (
<InnerBlocks allowedBlocks={ [ 'my-blocks/child-block', 'core/columns' ] } />
);
}
Now can I specify which blocks can be selected in the InnerBlock core/colums ?
*I know I could just let people add multiple child inside the parent, but I want them to be structured and responsive with the colums..
My other idea would be to somehow copy the core/colums block from gutenberg and modify it, though I don't know where to find it and it wouldn't really be pretty..*