Martin_Kentico
-
4/11/2006 1:53:17 PM
Re: HTML Editor Background
Hello,
Here is an example code you can use for changing the FCKEditor text area CSS style within the Editable region on your Page Template, you need to place it to the Page_Load event handler of your page:
'Find the inner FCKEditor Dim editor As FCKeditor = CType(Me.Region1.FindControl("FCKEditor" & Me.Region1.UniqueID), FCKeditor) 'If editor found, set the body CSS If Not editor Is Nothing Then editor.EditorAreaCSS = ResolveUrl("~/cmsdesk/aspnet_client/FCKEditor/editor/css/fck_editorareablack.css") End If
You need to copy the original fck_editorarea.css file to the new one and there you can change the editing body style and use it this way or you can edit the fck_editorarea.css itself to change the default body style of all the FCKEditor instances (for example to use your own page styles and formatting).
To change the style within the CMSDesk editing interface you will need to do the similar, but you need to find the particular FCKEditor control in the editing form, you can do that by placing following code to your CMSDesk/Content/Edit.aspx.vb codebehind file to override the Render event:
Protected Overrides Sub Render(ByVal output As HtmlTextWriter) 'Find the FCKEditor for the column name "ArticleText" Dim editor As FCKeditor = CType(Me.CMSForm1.BasicForm.FindControl("ArticleText"), FCKeditor) 'If found, set the body style class If Not editor Is Nothing Then editor.EditorAreaCSS = ResolveUrl("~/cmsdesk/aspnet_client/FCKEditor/editor/css/fck_editorareablack.css") End If MyBase.Render(output) End Sub
This example makes the "ArticleText" column editor use the different CSS body style than the others.
Similarly you can do this in any other page or control you need, all you need is to debug and find out the editor ID pattern you need to use for the searching by FindControl.
Hope this will help. If not, please feel free to ask about more help.
Best Regards
|