Sitecore富文本编辑器的分隔.css文件

Yur*_*hov 4 css sitecore rich-text-editor

我正在尝试在Sitecore富文本编辑器中使用自定义样式.我找到了文章,它描述了如何做,但我必须将我的样式放在default.css文件中.我想在分离的.css文件中添加我的自定义样式以避免潜在的问题(例如,在升级版本时覆盖默认的.css文件等).有没有办法一次使用default.css和custom.css文件?

jam*_*kam 8

您可以WebStylesheet将config中的设置值更新为您要使用的css文件的位置.然后RTE将加载它.

<!--
  WEB SITE STYLESHEET
            CSS file for HTML content of Sitecore database.
            The file pointed to by WebStylesheet setting is automatically included in Html and Rich Text fields.
            By using it, you can make the content of HTML fields look the same as the actual Web Site

-->
<setting name="WebStylesheet">
  <patch:attribute name="value">/location/to/custom.css</patch:attribute>
</setting>
Run Code Online (Sandbox Code Playgroud)

以上使用补丁配置来更新值.