Home Forums Gutenberg No Add Block Button in my InnerBlock


No Add Block Button in my InnerBlock

  • 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';
        '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>

    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. 🙂

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

You must be logged in to reply to this topic.