Support

Account

Home Forums Gutenberg Best practises to get (modified) custom field data in Gutenberg?

Unread

Best practises to get (modified) custom field data in Gutenberg?

  • In some cases, you can not use Gutenberg’s native Dynamic data fields or ACF’s own shortcode. Ie. if you have to format/manipulate the data before displaying it.

    I am finding that there are many ways to get ACF data in Gutenberg. What are the pros and cons of these techniques? What is the recommended way?

    1. Custom shortcode: create a shortcode for ACF data and use it with a Shortcode block. Seems to have some problems with the Query block.
    2. Filter / render_block: Give Gutenberg block a custom class and switch it to ACF content with filter. This works with the Query loop.
    3. Custom hook: Create a custom hook inside the Gutenberg block (requires a plugin/custom code).
    4. Some other, smarter way.

    Thank you for any input or links to more info. I am a bit confused about what to use.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.