开发者

Define CSS class's on tables in Sitecore

In one of my Sitecore solutions the user needs to have some predefined CSS class's that they can put on their tables created in the richtext editor from the back office.

When I go to the Table wizard I can see the CSS class dropdown list, but the only option that's 开发者_C百科available is one called "Clear class".

How can I define some more class's in that drop down list?


You want to find the following setting in the web.config:

<!--  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" value="/default.css" />

Whatever that CSS file is, that's the one where you can add your new classes. Once you change it, clear your browser cache and re-open the browser. The RTE should then get the new classes.


Problem:

Need to add predefined css in external css to RadEditor in Sitecore CMS

Solution:

  • Add css class to default.css which can be found in WEB_ROOT/Web.config on the following line:

    <setting name="WebStylesheet" value="/default.css" /> 
    

    Example css:

    .cufon {
      font-weight: bold;
      color: #666;
    } 
    
  • Modify the ToolsFile.xml defined in where the Sitecore uses the RadEditor (in my case: WEB_ROOT/sitecore/shell/Controls/Rich Text Editor/Default.aspx) and add the following lines:

    <classes>
      <class name="Clear Class" value="" />
      <class name="Cufon Book" value=".cufonBook" />
      <class name="Cufon Light" value=".cufonLight" />
    </classes>
    

Reference:

  1. RadControls – CSS Styles http://www.telerik.com/help/aspnet-ajax/cssstyles.html

  2. how to load css classes from my own project specfic css in Sitecore’s RAD editor? how to load css classes from my own project specfic css in Sitecore's RAD editor?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜