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
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
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
hmmm, just what I need to know too :)
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');
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
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');