Trying to make my first block using the InnerBlock feature, and I don’t have any button in my rendered block to add any blocks inside it.
Here’s my block definition:
$blockName = 'tabbed-nav';
acf_register_block_type(array(
'name' => $blockName,
'title' => __('Tabbed Nav'),
'description' => __('Display a tabbed nav interface.'),
'render_template' => 'blocks/'.$blockName.'/render.php',
'mode' => 'preview',
'category' => 'mm-blocks',
'icon' => 'align-pull-right',
'keywords' => array( 'tab', 'nav' ),
// 'enqueue_style' => get_template_directory_uri() . '/blocks/'.$blockName.'/styles.css',
//'enqueue_script' => get_template_directory_uri() . '/blocks/'.$blockName.'/scripts.js',
));
And heres my rendered block:
<div class="mm-custom-block tabbed-nav-block alignwide" style="min-height: 100px;">
<h2>this is the group block</h2>
<div><InnerBlocks /></div>
</div>
In the page editor, I can add my block without any problem. The <h2> text renders correctly, but after it I don’t have any button to click to add additional blocks to this block.
Anyone able to take a look at this code and suggest what I’m missing?

For innerblocks to work correctly you need to make sure you’re including ‘jsx’ => true in your ‘supports’ argument when registering the block, not seeing that.
'supports' => array(
'jsx' => true
)
Thanks. It turns out I pasted that snippet in the wrong place when I built out the block. I had it in the function defining the Field Group for the block instead of the Block’s definition. Not sure how I made that error, but that solved it, thanks. 🙂
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.