0

I have a multi line text field. It contains some embed code (script tags). If the content editor this works fine. But in the Experience Editor, saving the page strips the script's tags from this field. I know there is a setting for this on the Rich Text Editor, but this is a multi line text field.

Here is my markup:

<div>
    @Html.Raw(Model.EmbedCode)
</div>

Editing is accomplished with a custom experience editor button, so it opens a dialog which allows the user to edit the script. After editing this field, when you save the page, it strips script tags.

This is in Sitecore 8.0 Update 6.

2
  • We experienced something similar, but in 8.1. Support told us to use single-line (as work-around- or try the bugfix kb.sitecore.net/articles/148401. I don't think we tried the bugfix though..
    – Gatogordo
    Feb 10, 2017 at 15:34
  • The patch didnt work but changing to single line text did. Can you add that as an answer so I can mark as answered? Feb 10, 2017 at 16:12

2 Answers 2

4

In a similar situation (on 8.1 however) we were forced to change the field to a single-line text field.

Apparently there is a bug in the multi-line text that "might" clear the data when saving in the experience editor - in our case it was also when entering html data. A bugfix is made available (kb.sitecore.net/articles/148401) but we didn't test it so it might not fix your issue (the bugfix is for 8.1 as well).

So if you need a quick solution, change the field type to single line.

2
  • Did you found another solution besides changing from multi-line text field to single-line text field? (I've tried to apply the patch with out luck)
    – Phoenix_uy
    May 10, 2017 at 13:05
  • Not yet, but must admit we stopped searching as the single-line works for now (it's text that almost never changes).
    – Gatogordo
    May 10, 2017 at 13:10
0

Im using Sitecore 9.1 and rich text, single and multi-line fields strip iframe content (truncated) when editing other components in experience editor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.