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.
Just a quicky. I have a custom HTMLEditorField that I am loading into a form on a page. It is working pretty well and I have removed all but simple "bold","bullets" (etc) buttons.
I was wondering though, can I add custom CSS to this field? Maybe using HTMLEditorConfig? The default font is a little hard to read.
Currently the field is not loading editor.css, so I cant use that approach
Something like this?:
$cfgContent = HtmlEditorConfig::get('someIdentifier');
Now if I could only stop the bloody thing caching...
Thanks for your help.
Does this work?
$cfgContent->setOption('content_css', 'admintheme/css/editor.css?' .time());
Ooo, Thats a good idea, why have I never thought of that?? ;)
Any idea why this does not work? I get an error:
[User Error] Uncaught Exception: Object->__call(): the method 'setoption' does not exist on 'HtmlEditorField'
$Content = new HTMLEditorField("Content", "Post", 20,75);
$fields = new FieldSet(
new TextField("Title", "Title"),
new CheckboxField("Agree", 'Agree?')
setOption($k, $v) is a method of the HtmlEditorConfig class.
But you try to call it on an HtmlEditorField object (which totally doesn't know anything about it and is confused now ;-))