SocialEngine – Add or Remove Buttons in TinyMCE

tinymce tutorial

Want to add or remove buttons from TinyMCE for your SocialEngine site? No problem! This tutorial will show you how to do that. It’s written using 4.8.13. Note that this will involve source edits. If you don’t feel comfortable doing this yourself, submit a ticket to us and we can quote doing it for you.

For the main TinyMCE buttons, you’ll want to make the edits in the TinyMce.php file. If you find that your changes don’t show in some modules, you’ll need to edit those modules as well.

Copy the file \application\libraries\Engine\View\Helper\TinyMce.php so you have a backup of it.

Open it in your favorite text editor. We use either NetBeans, Sublime Text, Brackets or Notepad++.

Removing Buttons:

Find the following around line 56-74:

Remove the buttons you don’t want by deleting them from ‘toolbar1’. For example, to remove the ‘image’ button, delete ‘image’ from the list as shown below:

If you still see the button, follow the steps for adding buttons to “BBCODE” or “HTML” areas of the code, below. You also might need to edit the individual modules as shown below for the “Blog” module.

Adding Buttons:

Find around lines 56-74:

To add Emoticons (Smileys), you would add it as follows:

Noting that we added ’emoticons’ to the top ‘plugins’ array and to ‘toolbar1’ .

SocialEngine tutorial

Depending on your site settings, if the above doesn’t work, you might need to add the code to the “HTML” or “BBCODE” sections:

Find lines 154-170:

Add the ’emoticons’ button as shown:

If the button still doesn’t show on your site, you will need to edit the modules as each module that has TinyMCE also has controls for it.

Example below is for the Blog module.

in application/modules/Blog/Form/ find the Create.php file and make a copy of it so you have it for a backup.

Open it in an editor. In the Create.php file, around lines 85-95:

Add your buttons or plugins to the arrays.

Adding a plugin:

Above, we added ’emoticons’

and adding the button for Emoticons :

You see we added ’emoticons’ to the array.

Questions? Please ask in our forum.


Content Protection by