Override XHTML validation for Rich Text Fields in Sitecore
I'm trying to embed some renderings as detailed in this article. However when I try to add a rendering into a Rich Text field I get XHTML validation errors. I can't disable XHTML validation for the client so I wanted to extend the schema used for validation. This is stored in the /sitecore/shell/schemas directory.
The markup for the rendering I'm trying to embed is:
<smart:addresssnippet runat="server" />
I've tried to add a new schema for the smart namespace but this doesn't seem to work. When I go back to the HTML for the Rich Text field Sitecore has rewritten the code to be:
<smart:addresssnippet runat="server" xmlns:smart="http://www.sitecore.net/开发者_开发问答xhtml"></smart:addresssnippet>
This fails validation. Has anyone encountered this or a way to add renderings to the validation schema?
I've tested adding the following xml on my local instance to sitecore\shell\Schemas\xhtml.xsd and it renders you tag as you wanted and does not have validation errors in the Rich Text Editor.
<xs:element name="smart:addresssnippet">
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
</xs:choice>
</xs:complexType>
</xs:element>
I would contact Sitecore support here (provided you have a login for it) or maybe you could also try here.
精彩评论