Custom styles in Rich Text Editor problem

Vote:
 

Hi,

I'm trying to implement custom styles in the rich text editor as described here: http://marekblotny.blogspot.com/2009/05/how-to-define-custom-styles-in.html

My css file is like this:

1 : /* EPiServer.SpecializedProperties.PropertyXhtmlString  */
2 : h1 { EditMenuName: Header 1;}
3 : h2 { EditMenuName: Header 2;}

The different menu items (Header 1, Header 2) are displayed correctly in the drop down list, so the stylesheet is loaded into the editor. But if I select some text in the editor and choose for example Header 1 from the drop down list,  the editor only sets the tag </UNKNOWNED> behind the text.

Help would be highly appreaciated because I realy stuck here.

 

#48841
Feb 17, 2011 14:41
Vote:
 

You need to put a class in your rules.

It's that class that will be put as the lone class value on the selected element.

h1.customheading1 { EditMenuName: Header 1; font-color:red;}
h2.customheading2 { EditMenuName: Header 2; font-color:green;}

#48847
Feb 17, 2011 17:57
Vote:
 

I was wrong. Something like you had should work. Here's a working example:

h2 {EditMenuName:Rubrik 2;}
h3 {EditMenuName:Rubrik 3;}
h4 {EditMenuName:Rubrik 4;}
img.left {EditMenuName:Vänster;}
img.right {EditMenuName:Höger;}

It's might be a bad idea to let the editor set a h1 inside the editor... Normally page name should be h1 in the document.

#48848
Feb 17, 2011 18:05
Vote:
 

Thanks Johan. Your post did the trick! Now it works like a charm.

#48862
Feb 18, 2011 10:46
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.