17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 5334 Views |
-
tinymce config

8 April 2008 at 3:09pm Last edited: 8 April 2008 3:27pm
Which file(s) do I need to edit to change tinymce controls? I've configured tinymce controls in another cms, but simlar edits in SS don't seem to work (version 2.2.2-rc2).
Thanks
-Billy
-
Re: tinymce config

4 June 2008 at 4:45pm Last edited: 4 June 2008 4:45pm
hmmm, just what I need to know too
-
Re: tinymce config

4 June 2008 at 6:48pm
The code for all the TinyMCE buttons is located in /sapphire/forms/HtmlEditorField.php, in the HtmlEditorField_Toolbar class. Check out the buttons function. In order to edit the HTML Editor, but so your changes don't get lost on an update, copy the HtmlEditorField_Toolbar class to another file in your mysite/code directory e.g. AlternateToolbar.php. Also, rename the class name to AlternateToolbar. Once this is done, you can tell SilverStripe to use your custom class to use this instead of the default toolbar by placing
Object::useCustomClass('HtmlEditorField_Toolbar', 'AlternateToolbar');
Then any changes you make to the AlternateToolbar class will hopefully appear in the CMS. To edit/add/remove buttons, just edit the Buttons() function. The alternative is to wait until the next release, as I think the toolbar is being updated to be easily configurable. -
Re: tinymce config

5 June 2008 at 7:09am
I've followed your instructions, but I don't get it work!
Where do I have to put this line?!
"Object::useCustomClass('HtmlEditorField_Toolbar', 'AlternateToolbar');
I've put it into
mysitenamefolder/_config.php
-
Re: tinymce config

5 June 2008 at 10:04am Last edited: 5 June 2008 10:24am
Sorry, i'm afraid i made a mistake with my instructions. Currently the CMS interface doesnt use the factory method to create the toolbar, so the class will not get overridden. However, if you open up cms/code/LeftAndMain.php, and locate the EditorToolbar function, and replace it with
return Object::create('HtmlEditorField_Toolbar', $this, 'EditorToolbar');
then your custom class will get used properly. For your custom class, id suggest creating a class that extends HtmlEditorField_Toolbar in your mysite/code directory, and then putting the useCustomClass call in mysite/_config.php - and then override the Buttons function in your custom class.
| 5334 Views | ||
|
Page:
1
|
Go to Top |



