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

[Solved] CSS

7 Answers 85 Views
RadEditor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mike
Top achievements
Rank 1
Mike asked on 28 Jul 2006, 10:06 AM

Hi there,

Is it possible to stop the r.a.d editor using the default ows.css and specifiy a different one?

7 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 28 Jul 2006, 10:53 AM
Hi Mike,

Maybe you can modify the ContentEditor.aspx file and register any css files there. The location of that file depends on your deployment:

BIN:
C:\Inetpub\wwwroot\wpresources\RadWebParts\RadControls\EditorWebPart\Dialogs
GAC:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadWebParts\2.0.1.0__1f131a624888eeed\RadControls\EditorWebPart\Dialogs

I hope that helped,
Albert
the telerik team
0
Mike
Top achievements
Rank 1
answered on 28 Jul 2006, 11:12 AM

But does that not just modify the text whilst the editor is running??

Any text in the editor seems to use the WP-BODY class and I need it to use another one??

0
Atanas Korchev
Telerik team
answered on 28 Jul 2006, 11:16 AM
Hi Mike,

This behavior is by design. However I think you can override the .ms-WPBody css class in the ContentEditor.aspx per your requirements e.g.:

.ms-WPBody 
{
       background-color:red;
       color:white;
}

Regards,
Albert
the telerik team
0
Mike
Top achievements
Rank 1
answered on 28 Jul 2006, 12:25 PM

But that simply changes the font style within the editor itself - it doesnt affect how the text ends up looking on the page??

0
Atanas Korchev
Telerik team
answered on 28 Jul 2006, 12:33 PM
Hello Mike,

r.a.d.editor has no control how the text ends up rendered after saving. It is placed inside the webpart zone control which always applies the ms-WPBody class - you can view the generated source:
<div webpartid="1b6c4a7d-7d65-440d-850d-4a4112e0052e" haspers="false" id="WebPartWPQ2" 
    width="100%" class="ms-WPBody" allowdelete="false" style="">  
    r.a.d.<strong>editor </strong>content.</div> 
Unfortunately I am not aware of any way to disable this behavior - the class is rendered by SharePoint at runtime. You could either edit the default ms-WPBody class or wrap the contents of the editor inside another div with the correct class applied:
<div webpartid="1b6c4a7d-7d65-440d-850d-4a4112e0052e" haspers="false" id="WebPartWPQ2" 
    width="100%" class="ms-WPBody" allowdelete="false" style="">  
<div class="myClass"     
r.a.d.<strong>editor </strong>SharePoint Edition.  
</div> 
 
</div> 


I hope that helped,
Albert
the telerik team
0
Mike
Top achievements
Rank 1
answered on 28 Jul 2006, 12:42 PM

Hmmmm....is there anyway to include some default HTML in the editor?  That way I could put my own Div in automatically??

0
Dimitar Milushev
Telerik team
answered on 31 Jul 2006, 02:07 PM


Hello Mike,

Yes, there is a way to do this. You'll have to make a small modification to the web part. Find the RadWebParts directory in the "wpresources" folder. If the WebPart is installed in the GAC, the location is
C:\Program Files\Common Files\Microsoft Shared\web server extensions\wpresources
If it's not in the GAC, the location usually is
C:\Inetpub\SharePointRoot\wpresources
You can also use the IIS Manager to locate it.
Inside the RadWebParts folder, find and open "RadControls\EditorWebPart\Dialogs\ContentEditor.aspx" in a text editor. Find "<radE:RadEditor" and add OnClientLoad="OnLoad" as a property. It should look like this:

                <radE:RadEditor ID="contentEditor" OnClientLoad="OnLoad" 
                    Runat="server"   
                    OnClientSubmit="OnSubmit"   
                    OnClientCancel="OnCancel"   
                    CacheLocalization="True"   
                    DocumentsFilters="*.*" 
                    AllowThumbGeneration = "True">  
                </radE:RadEditor> 

Finally, inside the <script></script> tag, add the following function:

            function OnLoad()     
            {     
                if(window.radWindow && window.radWindow.Argument.Value=="")     
                {     
                    window.radWindow.Argument.Value = "<div class='MY_CLASS'>&nbsp;</div>";     
                }     
            } 

Inside the function, you can change MY_CLASS to the name of the class that you wish to set as default.

Sincerely yours,
Digibo
the telerik team
Tags
RadEditor
Asked by
Mike
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Mike
Top achievements
Rank 1
Dimitar Milushev
Telerik team
Share this question
or