Site logo

[Support request] Get ACF from page options to Hero block

Home Forums Support [Support request] Get ACF from page options to Hero block

Home Forums Support Get ACF from page options to Hero block

  • This topic has 11 replies, 4 voices, and was last updated 4 years ago by David.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1841758
    Jordi

    Hi, I created some fields with ACF and assigned them to “Options page”. Now I want to create a Hero with generatebloks. Is it possible to get ACF fields to view them in Hero?

    Thanks!!

    #1841771
    Elvin
    Staff
    Customer Support

    Hi Jordi,

    It should be possible with GP Premium 2.0’s dynamic settings on Block Element – Page Hero.

    Here’s an example: (Setting dynamic background image taken from ACF field value)
    https://share.getcloudapp.com/yAurJB0O

    All GenerateBlocks have dynamic settings within Block Element. 😀 You can set whatever field you wish to fetch on this setting.

    #1841798
    Jordi

    Hi, thanks for the reply.

    Yes, but if I assign the ACFs to the “Options page”, how do I display them?

    ACF GP

    ACF GP

    Thanks!

    #1841802
    Elvin
    Staff
    Customer Support

    Yes those settings are correct.

    Just make sure the field type is set to “Image” and actually returns an Image URL.
    https://share.getcloudapp.com/E0uAXe7m

    #1841851
    Jordi

    Yes, but it still doesn’t show the image.

    ACF GP

    ACF GP

    #1841945
    David
    Staff
    Customer Support

    Hi there,

    can you add a background image to the Container Block within the post editor – there has to be a background attached for the Dynamic Background to work.

    #1842130
    Jordi

    Yes, I have already added a background image but this still does not show the dynamic image.

    ACF GP

    —————–

    ACF GP

    —————–

    ACF GP

    —————–

    ACF GP

    —————–

    ACF GP
    In this space there should be the dynamic background image.

    #1842154
    David
    Staff
    Customer Support

    Can you share a link to where i can see the block being output ?

    #1843557
    Jordi

    Okay, I’ll send you it.

    #1843836
    David
    Staff
    Customer Support

    I am not sure – but i don’t think this will work from an ACF options page, according to the ACF docs:

    https://www.advancedcustomfields.com/resources/get-values-from-an-options-page/

    It requires the equivalent of a $post_id to be part of the get_field request.
    The GB Block element would expect the Custom Field to exist on the actual page or post.

    #2204266
    Dan

    Hi,
    Following up on this.
    Is there any possibility to call a field from an ACF options page.
    For example, creating a footer element with social icons (each with a link), I would like the links to be dynamic and populated from the ACF options page, and not statically inserted to each icon.

    Thanks
    Dan

    #2204628
    David
    Staff
    Customer Support

    Hi Dan

    I responded here:
    https://generatepress.com/forums/topic/acf-options-field-for-off-canvas-menu/#post-2204627

    Short answer – no using a GP Dynamic data setting but yes using ACF shortcode/block

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