21496 Posts in 5784 Topics by 2622 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1157 Views |
-
[solved] Custom HTMLEditorField

2 September 2010 at 3:58am Last edited: 2 September 2010 4:08am
Hi All,
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
Ideas?
Many thanks,
Mo
-
Re: [solved] Custom HTMLEditorField

2 September 2010 at 4:02am
Something like this?:
$cfgContent = HtmlEditorConfig::get('someIdentifier');
$cfgContent->setOption('content_css', 'somefolder/css/editor.css');
-
Re: [solved] Custom HTMLEditorField

2 September 2010 at 4:08am
GENIUS!!
Now if I could only stop the bloody thing caching...
Thanks for your help.
Mo
-
Re: [solved] Custom HTMLEditorField

2 September 2010 at 4:18am
Does this work?
$cfgContent->setOption('content_css', 'admintheme/css/editor.css?' .time());
-
Re: [solved] Custom HTMLEditorField

2 September 2010 at 5:06am
Ooo, Thats a good idea, why have I never thought of that?? ;)
Cheers,
Mo
-
Re: [solved] Custom HTMLEditorField

25 February 2011 at 10:45am
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);
$Content->setOption('content_css', 'themes/candy/css/editor.css');
$fields = new FieldSet(
new TextField("Title", "Title"),
$Content,
new CheckboxField("Agree", 'Agree?')
); -
Re: [solved] Custom HTMLEditorField

25 February 2011 at 12:18pm Last edited: 25 February 2011 12:18pm
Hi, 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 ;-))Cheers
Christian
| 1157 Views | ||
|
Page:
1
|
Go to Top |




