Website loses formatting when modifying it with RadEditor

4 posts, 0 answers
  1. jmctort
    jmctort avatar
    2 posts
    Member since:
    Oct 2008

    Posted 22 Oct 2008 Link to this post


    I deployed RadEditor in our farm and defined a custom .css-file as default style sheet, excluding the HtmlEditorTableFormats.css and HtmlEditorCustomStyles.css (according to the instructions in the article ).
    This worked very well, except one problem:
    When I access a website and try to modify it with RadEditor the text in a text field loses its formatting. Funny thing is that this happens only to single paragraphs, not in the whole text field.
    The paragraph seems to lose the linking to the .css-class in the style sheet (ApplyClass-dropdown menu shows only "ApplyClass").

    I can´t find a solution for this problem. The websites have been created before the installation of RadEditor, maybe there is a connection. The style sheet hasn´t changed though.

    I would be very thankful for some help and suggestions.

    Thanks and regards

  2. George
    George avatar
    859 posts

    Posted 23 Oct 2008 Link to this post

    Hi Thorsten,

    Indeed, Telerik RadEditor uses the same CSS files as the default rich-text editor - HtmlEditorTableFormats.css and HtmlEditorCustomStyles.css. But, it is possible for another global styles to be applied to the editor's content. Note that you can also set the styles to be applied to the content, by adding them in another location:

    Files/Common Files/Microsoft Shared/web server extensions/wpresources/RadEditorSharePoint/ 4.x.x.x__1f131a624888eeed/RadControls/Editor/

    This file is not created by default when you install RadEditor for MOSS. But, if it is present, the editor will automatically load it. However, the file will not be loaded in presentation mode when the editor is used in a list (e.g. wiki). This is because we cannot modify the page and add it when the editor is invisible. To workaround this problem you can include this file manually to the master page (using SharePoint Designer) or add it in the MOSS core CSS styles. Either way it will be automatically loaded in presentation as well as authoring (editing) mode. For example, to add the CssEditor.css file in the default MOSS styles, open the /Program Files/Common Files/Microsoft Shared/web server extensions/12/Template/ Layouts/1033/Styles/CORE.CSS and add the following line:
    @import url("/_wpresources/RadEditorSharePoint/4.x.x.x__1f131a624888eeed/RadControls/Editor/CssEditor.css");

    Please, add your custom styles to the CssEditor.css file and test the behavior. If the problem still exists, you can manually check what styles are applied to the content using Firebug.

    I hope this helps.

    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

  3. jmctort
    jmctort avatar
    2 posts
    Member since:
    Oct 2008

    Posted 23 Oct 2008 Link to this post

    Hi George,
    first thanks for the reply. I tried your solution, but unfortunately it had no effect. Here´s what I´ve done:

    I created the CssEditor.css and imported it in the CORE.css like you suggested.
    Additionally I left the entry <cssFiles><item name="pathto.css" /></cssFiles>
    in the ListToolsFile.xml and ToolsFile.xml. RadEditor still lost the formatting.

    After that I deleted the entries in ListToolsFile.xml and ToolsFile.xml to see if that does the job, but the formatting was still lost and additionally the styles of HtmlEditorTableFormats.css and HtmlEditorCustomStyles.css showed up in ApplyClass-dropdown again. 

    Are there any other options?

    Best regards,
  4. Lini
    Lini avatar
    2144 posts

    Posted 24 Oct 2008 Link to this post

    Hello Thorsten,

    The RadEditor content area is separate from the rest of the page and its CSS is also separate. As you already found out, you can use the <cssFiles> collection in the editor tools file to select which stylesheets will be loaded in the content area. By default these are HtmlEditorTableFormats.css, HtmlEditorCustomStyles.css, and CssEditor.css from the editor Resources folder. If you set <cssFiles>, then only the files you list will be added to the editor content area. If you want to have the default stylesheets and your custom one, then simply add them all as <item> entries in the <cssFiles> element.

    As my colleague suggested, you can use Firebug for Firefox or IE Developer toolbar for Internet Explorer to inspect the editor content and see if any custom styles are applied to the paragraphs and if there are, add them in your custom CSS file.

    Kind regards,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top