Support

Account

Home Forums Gutenberg Gutenberg blocks are not displaying ACF custom block content

Solving

Gutenberg blocks are not displaying ACF custom block content

  • Hi

    I made custom Gutenberg blocks with ACF and using custom fields there (only one field per block). But when building post/page content in block editor then blocks are just showing blank area although content in custom fields are filled. Somekind of bug/conflict for Gutenberg + ACF?

  • Are you using ACF Pro and have you created templates for your Gutenberg Blocks and called them via: acf_register_block()?

    Example:

    acf_register_block(array(
    			'name'				=> 'accordian',
    			'title'				=> __('Accordian'),
    			'description'		=> __('A custom accordian block.'),
    			'render_callback'	=> 'my_acf_block_render_callback',
    			'category'			=> 'formatting',
    			'icon'				=> 'no',
    			'keywords'			=> array( 'testimonial', 'quote' ),
    		));
  • I’m having this same issue at the moment. Did you ever figure out a solution?

  • Yes, after i created block template and coded it to show data (loop or show some fields etc) then Gutenberg started to show content inside blocks.

  • Sounds like a typo somewhere. Can you give the code of one of the broken blocks?

  • hi @ll 🙂
    I have the same issue now, I test it with the testimonial https://www.advancedcustomfields.com/blog/acf-5-8-introducing-acf-blocks-for-gutenberg/

    The custom-blocks for enter some content are not displayed, only the area of testimonial, but no fields to enter the content. I use WordPress 5.2.4 / Theme Twenty Seventeen. I tried the latest ACF PRO version and version 5.8.0-beta4.1 – Unfortunately without success.

    I’ve also seen the problem in GitHub, where Elliot wrote a solution.
    https://github.com/AdvancedCustomFields/acf/issues/79
    Unfortunately there is no path in the current WordPress version anymore, I can’t find the “includes/gutenberg/assets/js/acf-blocks.js”.

    @teetl6 – can you give mne your code-solution?

    does anyone still have any idea why the custom blocks aren’t displayed?
    Is it a ThemeProblem or Gutenberg?
    Thank you in advance for your help!

  • Ive the solution, it was my mistake, that I dont have choose the “BLOCK” in the main-editor position (I just didn’t see it) – before I choose just “POST” – Now it works great.. sometimes is so easy – I’m getting glasses. 🙂

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

You must be logged in to reply to this topic.