[Resolved] Dynamic post meta – is to possible to have multiline text?

Home Forums Support [Resolved] Dynamic post meta – is to possible to have multiline text?

Home Forums Support Dynamic post meta – is to possible to have multiline text?

  • This topic has 6 replies, 3 voices, and was last updated 2 months ago by David.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #2246583
    Gary

    Hi GP Team

    Hopefully a simple question, I’ve run into a situation where I need to output some dynamic post meta in a block element. That’s simple enough but the trouble is the post meta is multiline text content which requires line breaks and formatting.

    I’ve setup the ACF textarea field to keep formatting/line breaks but using GB’s dynamic data settings it seems to strip it out.

    Is there any way around this so multiline text can work with GB’s dynamic content options?

    Thanks

    #2246632
    Fernando
    Customer Support

    Hi Gary,

    By line breaks do you mean something like this?: https://share.getcloudapp.com/YEukdJJZ

    If you’re setting as such, even if you retrieve through code through ACF get_field function, it will appear as such with no break lines: https://share.getcloudapp.com/Wnu7EX8Y

    Can you try adding <br> as such to the text area: https://share.getcloudapp.com/llu04OWP

    This should work with Headline Blocks: https://share.getcloudapp.com/z8umnB9y

    Hope this helps! Kindly let us know how it goes.

    #2246931
    Gary

    Hi Fernando

    This does work, but unfortunately this particular field will be completed by other users who are unlikely to add <br> tags and will probably add multiple lines of text to the ACF textarea field, so I was hoping for something automatic.

    I’ve set the ACF textarea to add <br> tags for line breaks automatically hoping this would solve it but they must be getting striped somewhere. I was maybe hoping there might be a GP filter or some other workaround?

    Thanks

    #2246955
    Gary

    Hi Fernando

    I’ve found a solution for my needs so posting an update here in case it helps anyone else trying to do something similar.

    I realised ACF has shortcodes for grabbing values from a field in the editor, so I used a shortcode block in the block element template with the ACF field shortcode and set the ACF field to return formatting and it works great.

    Whilst this works fine for my purpose, it would it be nice if we could handle this natively though in GP/GB and be able to use GB block instead. Maybe Tom could provide some input on whether this is something the team has considered and whether it might be an option in future updates, I appreciate with the new GB betas dyanmic data is undergoing some changes.

    Thanks

    #2247039
    David
    Staff
    Customer Support

    Hi there,

    Do you want to raise a feature request on the GB Github?

    #2247653
    Gary

    Hi David

    Thanks for the reply and yes I’ll look to add this as a feature request on GB github.

    Thanks again

    #2248171
    David
    Staff
    Customer Support

    Thanks Gary! We appreciate the time taken to test and provide feedback!

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