Aru*_*mar 5 c# sitecore rte sitecore8
我试图将CSS类添加到Sitecore 8中的Rich Text编辑器中。我在web.config中包括了对CSS文件的引用,如下所示
<settings>
<setting name="WebStylesheet">
<patch:attribute name="value">/Stylesheets/Corporate/rte.css</patch:attribute>
</setting>
</settings>
Run Code Online (Sandbox Code Playgroud)
我的CSS类如下所示:
.utility.background-color-dark-blue:focus, .utility.background-color-dark-blue:hover {
background-color: #034b76;
color: #fff;
}
.utility.background-color-dark-grey {
background-color: #1a1b1f;
color: #fff;
}
Run Code Online (Sandbox Code Playgroud)
当我从RTE的下拉列表中选择CSS类时,它仅将“ background-color-dark-grey”类应用于该元素。我需要将CSS类应用为“ utility background-color-dark-grey”,以显示正确的样式。
有谁知道如何在sitecore中向RTE添加多个类?
您可以更新 Sitecore 的验证器以删除 Dot(.) 特殊字符吗?我猜类名是编辑器配置文件中列表项(/sitecore/templates/System/Html Editor Profiles/Html Editor List Item)的值,基本上sitecore不允许在值字段上添加点(.)。
渲染此 CSS 文件时不会出现错误异常,但 Sitecore 在用点 (.) 呈现包含多个类名的列表时会忽略特殊字符。