0

When I am trying to insert body tag in RTE, then RTE is removing once clicking on Accept (save) button. I am not surprised but wanted to know what else removed by default in Sitecore.

Like when I am trying to put complete HTML body with doctype as

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

then neither I am able to edit nor save the content in RTE. This issue is coming on one instance, and not coming on another instance of the same solution.

My question here is:

What are the other things which by default Sitecore removed, Are they configurable?

Is it good practice to put complete HTML with doctype in Sitecore RTE field?

I checked and found that Rick text field has Is XHTML applied, Do we have any relation with this?

  • 4
    No, why would you do that. This is very bad practice. The RichText field is for Rich Text, not to be used as an HTML editor, and certainly not to put the whole HTML body with doc type. Its for content. – Richard Seal Jun 19 at 12:02
  • No sure about your first question but I can say that it's not a good practice to put complete HTML with doc-type in RTE field. – Yogesh Sharma Jun 19 at 12:18
  • Another comment here, you have asked 3 questions in a single post. You should limit to a single question per post please. – Richard Seal Jun 19 at 16:25
-1

It's not a good practice to put entire HTML document into RTE field.

However, if do that, then Sitecore treats your text as valid Html and indeed the mentioned snippet will result in an empty page because there is no actual content. For example, the following HTML shows "My first paragraph." in RTE field:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><body>
<p>My first paragraph.</p>
</body>
</html>

There is a number of RTE configuration options defined in Sitecore.config. The summary is below. More information is in Sitecore.config.

  • HtmlEditor.DefaultConfigurationType

    Specifies the type responsible for setting up the rich text editor.

  • HtmlEditor.DefaultProfile

    Path to the default html editor profile.

  • HtmlEditor.LineBreak

    Specifies the tag that the HTML editor inserts on Enter. Values can be "br", "div" and "p".

  • HtmlEditor.RemoveScripts

    If true, the rich text editor removes script tags and inline scripts from RTE field values before saving. Setting the value to true reduces the potential for cross-site scripting and other script-related issues. Default value: true

  • HtmlEditor.SupportWebControls

    Indicates if the Html Editor supports web controls. If true, Web Controls are shown as yellow boxes. Default value: true

  • HtmlEditor.ValidatorServiceUrl

    Specifies the url that validates XHtml.

  • 3
    Feel free to edit the answer or leave a comment instead of downvoting. – grg Jun 19 at 13:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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