+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Adding Custom CSS Classname to WSYWIG Editor's body

Adding Custom CSS Classname to WSYWIG Editor's body

2 posts, 0 answered
  1. Keith
    Keith avatar
    1 posts
    Registered:
    19 Nov 2014
    08 Apr 2015
    Link to this post

    I'm developing on Sitefinity 7.3 and want to add custom CSS classnames to the WYSIWYG editor's body element which currently looks like:

    <body class="sfreContentArea">...</body>

     Would like to be able to do:

    <body class="sfreContentArea myCustomClass">...</body>

    Since this is embedded in an iframe and loaded on demand, I'm unable to access the editor when it loads.

    I've dug around quite a bit looking for a solution but haven't been able to come up with anything that's supported. Short of implementing a custom editor, which I've actually tried with no luck (no change in the editor itself, doesn't seem to recognize my custom editor) as outlined here: http://www.stratavie.com/developer-network/forums/designing-styling/custom-css-in-editor), the only other suggestions I've found are against older versions of Sitefinity, that recommend attaching a Javascript function to the load event of the editor which would be great if I could figure out how to do that in 7.3.

     

    Thanks.

  2. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    07 Dec 2016
    29 Apr 2015
    Link to this post
    Hello,

    In order to achieve you need you can add this class onClientLoad event.
    To doe so you can check this article as a sample:
    http://www.sitefinity.com/developer-network/knowledge-base/missing-styling-of-tables-inside-content-block-on-firefox

    the only change is that on step 2 you can replace the function as:
    function fixEditor(sender, args) {
        $(sender.get_contentArea()).addClass("myCustomClass");
    }

    Additional information could be found here.

    I hope the information above was useful.

    Regards,
    Svetoslav Manchev
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
2 posts, 0 answered