7 Answers, 1 is accepted
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
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??
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
But that simply changes the font style within the editor itself - it doesnt affect how the text ends up looking on the page??
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> |
| <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
Hmmmm....is there anyway to include some default HTML in the editor? That way I could put my own Div in automatically??
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'> </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