Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

[solved] HTML Editor Configuration doesn't seem to work for me

Go to End

7 Posts   3601 Views


Community Member, 904 Posts

5 March 2010 at 3:53am

Edited: 05/03/2010 4:13am

Hello all

I'm creating a website where I'd prefer to have different WYSIWYG-Editor configurations for different user-groups. Apparently, the CMS already supports that, by allowing the admin to specify a "HTML Editor Configuration" in the "Security" > "Permissions" tab.

The CMS sees my configurations and also displays them in the dropdown. Everything seems to be saved just fine, but the CMS doesn't apply the settings. It always uses the default configuration.
Is there something I have to do myself here? Get the current user-group and apply it's editor config?

Any insight would be appreciated. Thanks


Community Member, 904 Posts

5 March 2010 at 4:12am

Figured it out.
Member->getHtmlEditorConfigForCMS() looks up the editor config to use.
It selects the best editor config based on priority.. so if you don't set a priority for your config, you will always end up with the default config.

The following solved the problem (default priority is 0):

HtmlEditorConfig::get('customConfig')->setOption('priority', 1);


Community Member, 150 Posts

6 May 2010 at 12:23am


Could you explain how you managed to get the result of your first post in this thread. How did you create a custom HTML Editor Configuration and where did you put it?



Community Member, 904 Posts

6 May 2010 at 7:00am

Sure. A good place to define these configurations is in _config.php. Here's an example:

HtmlEditorConfig::get('cms')->disablePlugins('table', 'contextmenu');

// create a new config named "admin"
$cfg = HtmlEditorConfig::get('admin');

// set the name for the config dropdown
$cfg->setOption('friendly_name', 'Administrators');

// set the config priority (must be bigger than 0)
$cfg->setOption('priority', 1);

// enable some of the required plugins for silverstripe
// @see /cms/_config.php for the default config!
$cfg->enablePlugins('media', '../../tinymce_ssbuttons', 'fullscreen');

// customize your buttons here.. similar to example above?

After doing so, you should be able to select the config for each Member-Group (in the Permissions tab).
I don't know, if this is all the same in 2.4 though. Didn't try it yet. Also have a look at /cms/_config.php and the HtmlEditorConfig class to get some pointers how this all works.


Community Member, 150 Posts

6 May 2010 at 8:35pm

Many thanks!

I ended up with just overwriting the existing HTMLEditorConfig for a most simple WYSIWYG editor.

// Set custom TinyMCE configuration
HtmlEditorConfig::get('cms')->setButtonsForLine(1,'undo, redo, separator, cut, copy, pastetext, separator, ssimage, sslink, unlink, separator, fullscreen, advcode, formatselect');


Community Member, 4 Posts

9 November 2010 at 12:29am

Hi all,

I've just the same problem, but my solution doesn't change anything....

I just want to remove some buttons of the tinyMCE:

I've tried:
$cfg = HtmlEditorConfig::get('cms');

but there are still buttons in the third line and there is still the italic-button in the first

I would be very grateful for further assistance!


Community Member, 4 Posts

11 November 2010 at 2:10pm

Sry...i found my mistake!

Too much ' ... only one ' at the beginning and one at the end!

I'm so st***!