How to maintain formatting from the Document Type into modal content
Hi, I have a Team Members section of the site with portrait, name and position for each member. When you click the portrait, it loads a modal with a bio. I have tried the Property Editor as textarea and Richtext editor but it won't pull the formatting through in either case.
With textarea it just ignores the formatting, and with Richtext editor it adds all the HTML tags to the text. I'm not sure what I'm doing wrong here...?
Great, thanks! I was pulling through the bio via var bio = node.GetPropertyValue("bio").NullSafeToString(); so then in the modal-body called <div class="modal-body"><p>@Html.Raw(bio)</p></div>, which worked!
How to maintain formatting from the Document Type into modal content
Hi, I have a Team Members section of the site with portrait, name and position for each member. When you click the portrait, it loads a modal with a bio. I have tried the Property Editor as textarea and Richtext editor but it won't pull the formatting through in either case.
With textarea it just ignores the formatting, and with Richtext editor it adds all the HTML tags to the text. I'm not sure what I'm doing wrong here...?
I'm not sure how you're calling your bio property without seeing the code, but I'm assuming you're retrieving it as a string?
If so, you could wrap it in
Html.Raw()
to strip the tags, like so:Hope this helps!
Great, thanks! I was pulling through the bio via
var bio = node.GetPropertyValue("bio").NullSafeToString();
so then in themodal-body
called<div class="modal-body"><p>@Html.Raw(bio)</p></div>
, which worked!Thanks for your help!
is working on a reply...