[Support request] ACF block in dynamic template for CPT

Home Forums Support [Support request] ACF block in dynamic template for CPT

Home Forums Support ACF block in dynamic template for CPT

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1919842
    Dan

    Hi
    I would like to know if this is possible:
    Create a dynamic content template for a custom post type (GPP + GB), which includes an ACF block that the user can later add data to (in the block).
    so when the user creates a new post he will have the ACF block in the page waiting for data insert.

    Thanks!
    Dan

    #1919965
    Elvin
    Staff
    Customer Support

    Hi Dan,

    It’s definitely possible.

    You can add in a GB Headline block for this and set the dynamic value to retrieve post meta and place the slug of your ACF on the text provided. https://docs.generatepress.com/article/dynamic-data/#post-meta

    https://share.getcloudapp.com/lluoElqG

    #1921587
    Dan

    Thank you Elvin,
    but does GP support adding a ACF block (with multiple fields) in the template? I didn’t see you mentioned that.

    Dan

    #1922204
    David
    Staff
    Customer Support

    Hi there,

    Content Templates replace the themes content.php – they don’t return anything inside the post content or the post editor.
    But to cover what Elvin said, any single value ACF field ( added via the ACF Meta Box ) can be included in the Content Template.

    #1922228
    Dan

    Thanks David,
    So for the ‘simple’ ACF fields I can use the heading block with the dynamic option, but for more advanced fields (repeater for example) or even ACF blocks, this cannot be achieved via the content template.
    Will GP introduce a template editor, where I can create a complex page which includes various types of blocks layouts (including custom blocks)? A template that can be then controlled in a centralized way where making a change will also be applied to all pages based on that template (like page, single and CPT template behave)?

    Thanks for your support,
    Dan

    #1922300
    David
    Staff
    Customer Support

    You can add ACF ( or any custom field ) to any of the GB / GP Blocks that support the Post Meta type. Not just the Headline Block 🙂
    And you’re not limited to just using GB / GP Blocks in Block Elements. If you want to add a custom Block whether that be ACF or your own making you can. And as alternative, you can also add shortcodes.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.