views:

37

answers:

1

Is there a good way to force pasting as text inside Rich Text Fields inside Sitecore? I know there's a "Paste as Text" button in the Rich Text Editor itself, but content authors are almost definitely going to just hit Ctrl+V or Right-Click->Paste to put the text in, and if that content came from Word, all hell breaks loose with the markup. The workaround we have so far is to paste into notepad and then to copy that text and paste it into the Rich Text Field, but that solution is inelegant and I hate it.

Thank you for your time.

A: 

Take a look at the setting

<property name="StripFormattingOnPaste">None</property>

Located in the file /sitecore/shell/radcontrols/editor/ConfigFile.xml

Last time I had a requirement similar to yours, I went in there and made the change and it worked fine. Should still work, unless they changed something :-)

Mark Cassidy
Thanks for your response! I think that it's exactly what I need. I see the line in the .xml file, but the change doesn't seem to be affecting anything. Do I need to do something in particular for Sitecore to re-read the xml file? (Sorry- I've never edited any of the Sitecore config files aside from the web.config). So far I've tried smart-publishing and invalidating the web.config cache to try and get it to work but no dice yet
raynjamin
After some more research I found out the file here: \sitecore\shell\Controls\Rich Text Editor\default.aspx has a very similar setting related to stripping formatting. Setting the line StripFormattingOnPaste="MSWordRemoveAll" gave me the results I needed.
raynjamin
Ah, yes. Apologies, I forgot about the .aspx file... Now that you mention it, I do remember it was involved when I last did this myself.Glad it worked out for you :-)
Mark Cassidy