Technical support This forum is closed.
Version 1.x > Technical support > want to apply style in FCKeditor "Editable region" View modes: 
User avatar
Member
Member
Bipul Dobhal - 9/28/2006 8:33:22 AM
   
want to apply style in FCKeditor "Editable region"
Hi,

I want to add my own style in Editable region and able to apply styles for individule styles,color,size by adding some more style tags in fckstyles.xml like this

<Style name="Blue Ruler" element="hr">
<Attribute name="size" value="1" />
<Attribute name="color" value="#C0CDD9" />
</Style>
<Style name="Paragraph Body" element="span">
<Attribute name="style" value="FONT-SIZE: 10px; FONT-FAMILY: verdana,arial,sans-serif;" />
</Style>
<Style name="Paragraph Heading" element="span">
<Attribute name="style" value="FONT-SIZE: 10px; FONT-FAMILY: verdana,arial,sans-serif;font-weight: bold;" />
</Style>

But when i add same style tag for css class like

<Style name="MyClass" element="span">
<Attribute name="class" value="MyClass" />
</Style>

this effect is not reflected their, even i made change in "fckconfig.js" file to point my own css file like

FCKConfig.EditorAreaCSS = '/CSS/myownstyle.css' ;


as "myownstyle.css" is a style sheet made by me to render changes in pages..

kindly suggest me how to render my css class effect in editable region..


Thanks,
Bipul Dobhal

User avatar
Guest
admin - 9/28/2006 8:54:06 PM
   
Re: want to apply style in FCKeditor "Editable region"
Hello,

changing the EditorAreaCSS value has no effect since the CSS styles are always used from the file main.css in the root of your web project.

Best Regards,

User avatar
Member
Member
Bipul Dobhal - 9/29/2006 7:52:37 AM
   
Re: want to apply style in FCKeditor "Editable region"
Hi,

I m successfully able to made it works as follows;

1. I made my own css class named "myClass.css" and made some classes there like paragaraph body, paragaraph heading etc.

2. Then I added the styles in fckstyles.xml file like

<style name="Paragaraph Body" element = "span">
<artribute name="class" value="ParagraphBody">
</style>
like this I added the style according to my classes defined in the .css file

3. replaced the existing line with FCKConfig.EditorAreaCSS = "/myClass.css"; in fckconfig.js file.

4. then added new key in appsetting tag in web.config file having "CMSCSSVirtualPath" as a key and the path of the .css file as value.

And then after comipilation its working successfully....


But now i want to do same as "format" dropdown but the problem is that there is no any .xml file for format as fckstyles.xml file.
As i had defined my new styles in fckstyles.xml file there should aslo fckFontformat.xml type file..

Can any one shed a light on this ??

Thanks,
Bipul Dobhal

User avatar
Member
Member
trint99 - 10/9/2006 4:40:21 PM
   
Re: want to apply style in FCKeditor "Editable region"

Rather than adding your own CSS file (and changing what FCK uses for styles), you could add the styles you need to the main.css file used by Kentico. Just be sure that main.css is included in your page template. That's what I did. But then I've also heavily modified the main.css for my web site.

In my site, I gave up trying to edit the format drop down. I use that only for the basic types, such as H1, H2, etc. Instead, I created new styles using the style menu. There I have a style which wraps the selected text in a div tag and applies the CSS I needed.

<Style name="Rounded Box" element="div">
<Attribute name="class" value="RoundedBoxDefault" />
</Style>

What kind of tag are you trying to add to the format that can't be added to the style?

User avatar
Member
Member
Bipul Dobhal - 10/12/2006 9:10:04 AM
   
Re: want to apply style in FCKeditor "Editable region"
Hi Trint99,

As there is some formats displaying in the format combo box like Normal ; Normal Div; Address etc, I want to add my own formats For example named Table_Col2 and when I will Click on the table a simple table with 2 columms be rendered there.. this is just an example to explain my views.

I know that there is a table icon available in FCKeditor but above table is just an example.

Means I want totally to reformat that combo box..

Thanks,
Bipul Dobhal

User avatar
Member
Member
trint99 - 10/12/2006 6:40:29 PM
   
Re: want to apply style in FCKeditor "Editable region"
Hmm. I haven't found a way to do that. Maybe Kentico staff could help us both. :)

User avatar
Guest
admin - 10/13/2006 3:15:36 PM
   
Re: want to apply style in FCKeditor "Editable region"
The format dropdown cannot be extended with your styles AFAIK. However, you could enable the Templates button in the FCKEditor. It allows you to predefine "HTML snippets" that can be inserted into the text, such as two-column table.

You can enable this by adding a new item 'Templates' into the FCKConfig.ToolbarSets["Default"] array.

The templates can be edited in the fcktemplates.xml file.

Regards,