Support

Account

Home Forums Gutenberg Used InnerBlocks multiple in one ACFBlock Reply To: Used InnerBlocks multiple in one ACFBlock

  • It’s easy!
    Just change the way You think about the inner blocks as they’ll always have “only one place” to include the inner blocks.
    Is all about making more blocks + limit blocks that You can insert + default block template.

    1. Make a container block with innerblocks and name it like “Two Columns: Layout A”
    2. Make a child block called “Two Columns: Layout A – Left Column”
    3. Make a child block called “Two Columns: Layout A – Right Column”

    Now create template with lock function for each blocks mentioned above:

    • 1. Container – template with allowed only: 2 and 3 (blocks left & right column)
    • 2. Left Col. template with allowed only: ‘core/list’, ‘core/button’, ‘core/image’
    • 3. Right Col. template with allowed only: ‘core/heading’, ‘core/paragraph’

    More to read: resources/acf_register_block_type – look for: allowedBlocks, template & templateLock.