- This topic has 6 replies, 3 voices, and was last updated 2 months ago by David.
June 7, 2022 at 4:24 pm #2246583Gary
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?
ThanksJune 7, 2022 at 6:22 pm #2246632Fernando Customer Support
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.June 8, 2022 at 2:22 am #2246931Gary
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?
ThanksJune 8, 2022 at 2:50 am #2246955Gary
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.
ThanksJune 8, 2022 at 4:08 am #2247039DavidStaffCustomer SupportJune 8, 2022 at 12:25 pm #2247653Gary
Thanks for the reply and yes I’ll look to add this as a feature request on GB github.
Thanks againJune 9, 2022 at 6:14 am #2248171
- You must be logged in to reply to this topic.