Support

Account

Home Forums Gutenberg Require a block to be a child of another block

Solved

Require a block to be a child of another block

  • I’m using ACF blocks to create a restaurant menu. I have a container block (called “Menu”) which will contain either Food or Drink blocks.

    Is there a way that I can make the Food and Drink blocks only available when inside of a Menu block? As it stands now, one can add a Food block right alongside a Paragraph or Heading in the body of a post or page. These blocks should not be accessible outside of the Menu parent block.

  • You can use the parent property in the block.json file when registering the food & drink blocks.

  • There it is! Thank you!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.