Technical support This forum is closed.
Version 1.x > Technical support > HTML Editor Background View modes: 
User avatar
Member
Member
RHavlick - 3/25/2006 11:00:25 PM
   
HTML Editor Background
Hello,

For one of the sites I've used Kenitco for, the graphic artist has created a style sheet with the body's background as black. So the main.css looks like:

body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #000000;
}

He then has overlayed tables, and images over the background with other colors. The text on the site is always black.

The problem is that I have a document template with a template attribute who's field type is a HTML Area (Formatted Text). While in the CMSDesk and editing one of those fields, the background shades as a black, and black text on a black background can't be seen. Is there any way to have the HTML Editor's use a different stylesheet or override the background color by default so that the users of this site can see what they are editing?

Thanks.

User avatar
Guest
admin - 3/26/2006 6:34:05 PM
   
Re: HTML Editor Background
Hello,

Thank you for your message. You will need to set the Body background on the page-level like this:

<body class="blackBody">

and change the name of your CSS style like this:

.blackBody {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #000000;
}

Best Regards,

User avatar
Guest
rhavlick - 3/27/2006 5:44:24 PM
   
Re: HTML Editor Background
Cool, thanks, I'll give it a shot.

User avatar
Member
Member
RHavlick - 4/9/2006 2:16:50 AM
   
Re: HTML Editor Background
I am just getting around to working on this, unfortunately this doesn't seem to work. Do you have any other ideas? Thanks.

User avatar
Member
Member
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


User avatar
Guest
admin - 4/11/2006 5:32:00 PM
   
Re: HTML Editor Background
To RHavlick: could you please post the code of your ASPX page template here?

Thank you.

Best Regards,

User avatar
Member
Member
RHavlick - 4/15/2006 5:51:15 PM
   
Re: HTML Editor Background
Actually I tried all the above solutions, plus tried to change the FCKEditor's style sheets with no luck.

What I did do though, was I removed the background-color from my Main.CSS in the body element. I just made a 1x1 pixel black gif file and used <body background="blackbackground.gif">

Thanks for your help.

User avatar
Member
Member
Martin_Kentico - 4/18/2006 8:52:27 AM
   
Re: HTML Editor Background
Hello Ryan,

Well, that's strange, changing the CSS file the way I posted worked for me very well. If it didn't help in your case, maybe there will be some issues with the file caching within your browser.

Best Regards