Support

Account

Home Forums Gutenberg Inserter Help Panel Reply To: Inserter Help Panel

  • I believe what you are looking for is the attribute “example” I haven’t tested this, but hopefully this gets you on the right track. Let me know how you go.

    From this page: https://www.advancedcustomfields.com/resources/acf_register_block_type/
    It mentions

    $settings
    (array) (Required) Array of arguments for registering a block type. Any argument from the JavaScript registerBlockType() function may also be used.

    Looking at the Gutenberg Docs:
    https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#example-optional

    So for example if you have a block with a Title and Description fields you add them into an attributes array:

      acf_register_block(array(
        'name'				=> 'testBlock',
        'title'				=> 'Test Block',
        'description'		=> 'A Test block which should hopefully show an example in the help panel',
        'render_callback'	=> 'testBlockRender',
        'category'			=> 'formatting',
        'icon'				=> 'admin-comments',
        'keywords'			=> array( 'Test' ),
        'example' => array(
          'attributes' => array(
            'title' => 'Title',
            'descrpition' => 'A Description',
          ),
        ),