Vulnerability in EPiServer.Forms

Try our conversational search powered by Generative AI!

Custom styles in Rich Text Editor problem



I'm trying to implement custom styles in the rich text editor as described here:

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.


Feb 17, 2011 14:41

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;}

Feb 17, 2011 17:57

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.

Feb 17, 2011 18:05

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

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.