Try our conversational search powered by Generative AI!

How to configure CSS classes for the image editor


Is there a way to specify a separate set of say 2 CSS classes that should be available in the image editor?

The TinyMCE editor is working just fine and displays styles that I've named using

the special EditMenuName: property.

I've configured my


At the moment it seems that all classes from my editor.css plus some additional epi-classes gets added.

The classes that I've decorated with EditMenuName: is listed as the class name and not the EditMenuName:"My special style" etc.

Image editor

Nov 19, 2014 13:40

I'm not sure why all editor.css classes are added to the list initially (seems counter-productive as these are very likely not styles that you'd use in your template designs).

The image editor is part of TinyMCE, but it not the same as the XHTML editor you would add styles to using the uiEditorCssPaths attribute.

For the image editor you'd probably need to override some init settings.

Googled this quickly:

    plugins: "image",
    image_class_list: [
        {title: 'None', value: ''},
        {title: 'Dog', value: 'dog'},
        {title: 'Cat', value: 'cat'}

Here's an example of how to include your new init settings for tinymce:

Nov 20, 2014 10:57

Thanks for the input Arild you led me in the right direction and I got it working now.

I discovered that the plugin in question was "advimage" and not image

That plugin has an option named


If that option is not defined TinyMCE lists the classes imported from the editor.css.

So I have it configured like this now
theme_advanced_styles : "Image left=img-left;Image right=img-right;"
Nov 21, 2014 9:49

Good stuff, Peter! I should have recognized that.

For future reference, here's a blog post showing how to get EPiServer to pick up the custom theme_advanced_styles settings (CMS 6):

Nov 21, 2014 9:57

I tried the blog post with EPiServer 7.5 but it doesn't work for me. My TinyMCEeditors lost the will to live. Literally.

Feb 23, 2015 15:34

The PluginName had to be advimage so the example for CMS 6 while good was just confusing as it doesn't work as-is for CMS 7. So thank you to both of you guys - the clues were all there it just required a bit of detective work to get there in the end.

This worked for me:

using EPiServer.Editor.TinyMCE;

    [TinyMCEPluginNonVisual(AlwaysEnabled = true,
    PlugInName = "advimage",
    DisplayName = "Init options",
    Description = "Init options for the HTML editor",
    EditorInitConfigurationOptions = @"{
          paste_auto_cleanup_on_paste : true,
          theme_advanced_styles : ""Image left=img-left;Image right=img-right;"",
          theme_advanced_resizing : true }")] 

    public class TinyMceSettings

Feb 23, 2015 16:25

I'm trying to get this working on an EPiServer 8 site, but am not having any success using the code in the previous comment.

Has anything changed in recent versions which would stop this working?

May 22, 2015 16:17

I also wanted to add some "theme_advanced_styles" to TinyMCE in edit mode. It looks like "TinyMCEPluginNonVisual" code that "John Walsh" was posted not working in EPiServer 8. Can anybody tell how to use this code in EPiServer 8 and above ?

Oct 29, 2015 16:16

Me three!

Jan 28, 2016 18:14

This works in v9 at least:

Can't remember if I had to do anything else to make it work, but I don't think so. Key to having them in the image dialog is to use the img tag specifier in the css.


Jan 28, 2016 19:24

All I am trying to get this working in an Episerver 9 project. I have had zero success. It doesn't even look like the alloy build was able to acomplish this, and much of the documentation linked above has moved. Could someone please point me in the correct direction? 

Note: the tinymce "styles" drop down is working fine. it is the advimage class dropdown that is not being populated.

Nov 16, 2016 22:17

Hi Joshua,

that is strange. I've got this working on a demo site (check that editornames.less link above).

Given - this is EPiServer.CMS.Core 9.7.2 (EPiServer.CMS.UI 9.4.2), it could have changed in later versions, I know that dialog has been touched by developers since then.


Nov 16, 2016 22:44

I can confirm it works in later versions of CMS 9

Nov 17, 2016 14:08
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.