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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Customising the CMS /

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

Using several HTMLEditor Configs in CMS


Go to End


2 Posts   1501 Views

Avatar
Lukin

Community Member, 56 Posts

18 October 2010 at 11:28pm

Hi,

I need two different configs for my htmlEditorFields...

I put that code in my class-file to delcare my cusom config and added a second HTMLEditorField, work's fine
but the Content HTMLEditor uses my custom config too

I tried to set_active the standard config after adding my second editor but that doesn't help..

HtmlEditorConfig::get('reduced')->disablePlugins('table');
HtmlEditorConfig::get('reduced')->setButtonsForLine(1,
'bold','italic','underline','strikethrough','separator',
'formatselect','separator',
'sslink','unlink','separator',
'bullist','numlist','hr','charmap'
);
HtmlEditorConfig::get('reduced')->setButtonsForLine(2);
HtmlEditorConfig::get('reduced')->setButtonsForLine(3);

$zusatzZeile=new HtmlEditorField('Zusatzzeile','ZusatzZeile',1);
HtmlEditorConfig::set_active('reduced');
$fields->addFieldToTab('Root.Content.Main',$zusatzZeile,'Content');
HtmlEditorConfig::set_active('cms');

thanks in advance

Avatar
bummzack

Community Member, 904 Posts

19 October 2010 at 5:01am

I had the same problem once. The problem turned out to be the priority of the config.
See this thread: http://www.silverstripe.org/general-questions/show/280243