Support

Account

Home Forums Gutenberg Dynamic blocks

Solving

Dynamic blocks

  • Can a dynamic block be created with ACF?

    Meaning a block that just returns the latest three posts of a post type or something like that?

    Or are the blocks made with ACF only capable of static content that gets saved?

  • There isn’t a reason to use ACF for something like this. The most recent posts of a post type can be done without ACF in WP using a query, there are many shortocde plugins that will do this. I’m not sure, but I’d guess that someones already built a block to do something similar with a CPT.

  • Um…
    Why would there be no need?

    I’m making a site. The user can choose to add a block that shows the latest portfolio items on their site. They can choose how many to show and I can give other options.

    ??

  • You could use acf field for blocks, but I can’t give you any specifics other than the acf block documentation here https://www.advancedcustomfields.com/resources/blocks/ and here https://www.advancedcustomfields.com/blog/acf-5-8-introducing-acf-blocks-for-gutenberg/

  • I just want to know if the fields made with acf can be dynamic like the Gutenberg native latest posts block.

    • NickDA

    • July 15, 2019 at 3:04 am

    Of course you can… why would you think you would not? The rendering file, is actually a php file, so what do you think would stop you. From the plugin repository if you download the “ACF Blocks” – https://wordpress.org/plugins/acf-blocks/ there is a Post Block just to prove that it is possible.

    The reason to use Gutenberg blocks as oppose to shortcodes are very obvious, besides, your customers will prefer to click things to work, as oppose to using shortcodes.

  • I figured the blocks were all saved statically to the post content.
    According to the handbook for Gutenberg extra work has to be done to make a dynamic block.

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

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.