This is a migrated thread and some comments may be shown as answers.

ContentAreaCssFile... multiple files?

2 Answers 36 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Marja
Top achievements
Rank 1
Marja asked on 04 Feb 2014, 10:46 AM
Hi,

We're using the RadEditor in the administration area of our custom CMS, and we'ld like to be able to specify multiple files for the ContentAreaCssFile property:
  1. the main website skin CSS file of the target website, so the (text) styling in the editor looks familiar to the person editing the content
  2. a temporary CSS file just for the editor itself, eg. to specify a temporary visible (dashed) border for a DIV element which is inserted using a custom dialog

How do we accomplish this?

Best regards, Marja


2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Feb 2014, 11:35 AM
Hi Marja,

Please have a look into the sample code snippet for multiple ContentArea Class for one RadEditor.

ASPX:
<telerik:RadEditor ID="RadEditor1" runat="server">
</telerik:RadEditor>

CSS:
<style type="text/css">
    .Contentarea1
    {
        color: White !important;
        background-color: Red !important;
    }
    .Contentarea2
    {
        color: Black !important;
        background-color: Yellow !important;
    }
</style>

JavaScript:
<script type="text/javascript">
    function ChangeClass() {
        var editor = $find("<%=RadEditor1.ClientID %>");
        if ( //your code for condtion)
            editor.get_contentArea().className = "ContentArea1";
        else
            editor.get_contentArea().className = "ContentArea2";
    }
</script>

Thanks,
Shinu.
0
Ianko
Telerik team
answered on 06 Feb 2014, 11:32 AM
Hello Marja,

You can use also the ContentAreaCssFile property in a custom Server-side logic, which implements the logic to set the desired CSS file of the content area.

You can examine this live example for more information on this matter.

Regards,
Ianko
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Editor
Asked by
Marja
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ianko
Telerik team
Share this question
or