Site logo

[Resolved] “Block – Hook” with Dynamic Data X ACF

Home Forums Support [Resolved] “Block – Hook” with Dynamic Data X ACF

Home Forums Support “Block – Hook” with Dynamic Data X ACF

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2576698
    webintas

    Hi there,

    I am trying to get used to using your “Block – Hook” element. I want to use it for a sidebar widget for a custom post type where some content is static and some content is dynamic from ACF.

    The static content is easy. Also the SIMPLE dynamic data (e.g. a text line) but I am running into issues when trying to output data from ACF where the data format is an array. Also text area where <br> or <p> tags are automatically added through the ACF settings is not working (no line breaks is added).

    So how could I handle this? Is it possible to write some PHP in functions.php where I output the more advanced field and then hook into the “Block – Hook” element.

    I hope the request is clear. I am looking forward to hearing from you.

    Best Regards,
    Peter B. Stidsen

    #2576806
    David
    Staff
    Customer Support

    Hi there,

    you would need to create an ACF Shortcode to return content from an array.
    You can add shortcodes inside a GenerateBlocks Headline Block if you want to use its styling controls.

    We will be added ACF array and other feature support to a future GenerateBlocks Pro release.

    Let me know if you need any more details.

    #2576866
    webintas

    Hi David,

    So how do I create such shortcode?

    #2577086
    David
    Staff
    Customer Support

    If its a simple text then ACF comes with some baked in shortcodes:

    https://www.advancedcustomfields.com/resources/shortcode/

    If its more advanced then it requires some PHP.
    And that will vary depending on what the field does.

    So what does the field display ? eg. a list of text, or images ….

    #2577127
    webintas

    One field is just a text area where line breaks should be included.

    The other field is a Google Map which should have output as here: https://www.advancedcustomfields.com/resources/google-map/#template-usage

    #2577304
    Ying
    Staff
    Customer Support

    I would recommend reaching out to ACF’s support for how to generate the shortcode.

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