Lost tag in wysiwyg field in “views”
- This topic has 9 replies, 2 voices, and was last updated 4 years, 7 months ago by
Erik.
-
AuthorPosts
-
May 12, 2021 at 9:45 PM #28129
Erik
ParticipantHi,
How can I keep the formatting of my wysiwyg field in “views”. It keeps the <h3> but all <p> tags are lost.
Thanks in advanceMay 13, 2021 at 11:11 AM #28141Long Nguyen
ModeratorHi Erik,
I do not see this issue on my end. Did you enable the setting
Save data in the raw formatin the Builder? See more on the documentation https://docs.metabox.io/fields/wysiwyg/#settingsMay 14, 2021 at 8:15 PM #28184Erik
ParticipantHi,
I choose that option but it does nothing. Only the “h” tag is kept.
I saw on twig documentation that it comes with filter for text but when I declare that :
{{ clone.contenu|wpautop }}. It breaks my site 🙁
Thanks for your helpMay 15, 2021 at 4:21 PM #28204Long Nguyen
ModeratorHi Erik,
Checked that option means the editor does not save the
<p>tag that automatically applies when you hit enter to break the line. See on the documentation https://docs.metabox.io/fields/wysiwyg/#settingsIf you want to save data in raw format, e.g. exactly the same as you enter in the editor without applying wpautop() function. Can be true or false (default). Optional.So please uncheck the option
Save data in the raw formatto save the<p>tag.May 15, 2021 at 8:34 PM #28207Erik
ParticipantHi,
Thanks for your explanation, but there is still a problem. I make some screen capture
Thanks for your support
https://share.getcloudapp.com/KoudoneQMay 16, 2021 at 4:01 PM #28215Long Nguyen
ModeratorHi Erik,
So please share the full code that you are using to show the field value, I will try to reproduce the issue on my end.
May 16, 2021 at 6:12 PM #28219Erik
ParticipantHi,
here is the code of the “views" :<div class="accord-container"> {% for clone in post.rubrique %} <button class="accordion">{{ clone.titre }}</button> <div class="panel"> {{ clone.contenu }} </div> {% endfor %} </div>Thanks
May 16, 2021 at 9:18 PM #28221Long Nguyen
ModeratorHi,
It looks like you have a cloneable group with subfields title and content. I've tried to reproduce these fields on my local site but still cannot see the issue. The
<p>tag displays on the frontend as well. Please share your site credentials via this contact form https://metabox.io/contact/, I will check it out.May 17, 2021 at 10:17 PM #28237Long Nguyen
ModeratorHi Erik,
Thank you for your additional information. I see that the WYSIWYG subfield in a cloneable group does not automatically add the
<p>tag when using the Classic editor. Please use the Block editor instead and re-create the content. I will escalate this case to the development team to check it.May 17, 2021 at 10:26 PM #28238Erik
ParticipantHi Long,
Thanks for your report. I am in noway situation with this 🙁
Hoping that the dev team resolves this quickly
Best regards
Erik -
AuthorPosts
- You must be logged in to reply to this topic.