TinyMCE : Organise toolbar buttons

SeanBannister - January 14, 2008 - 01:05
Project:Google Highly Open Participation Contest (GHOP)
Component:GHOP Task
Category:task
Priority:normal
Assigned:Unassigned
Status:active
Description

TinyMCE is a WYSIWYG editor that is very popular with Drupal. There is currently a TinyMCE module (http://drupal.org/project/tinymce) for drupal that allows you to easily plug it in.

The TinyMCE editor has a toolbar on which buttons are placed. These buttons can be organised by rearranging the order, adding separators and specifying what row of the toolbar the button is place on. The problem with the TinyMCE Drupal module is it doesn't allow buttons to be rearranged or separators to be added.

The functionality that would need to be added to the module :
Add a button (functionality already exists but would need changing)
- Specify the row of the toolbar the bottom should be placed on
- Specify the Weight(order) of the button
Add a separator (just like any other button), and specify it's location.

You can read up on the placing of TinyMCE buttons at http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/theme_advanced...

There is also some example code by markus_petrux who implemented a hack to add this functionality at http://drupal.org/node/176223

Resources
http://drupal.org/project/tinymce
http://tinymce.moxiecode.com
http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/theme_advanced...
http://drupal.org/node/176223

Primary Contact
SeanBannister

#2

Jkello - May 21, 2008 - 03:40

Is this still going to happen? Just wondering.

Thanks.

#3

SeanBannister - May 30, 2008 - 11:40

Well it was set as a GHOP task but never got done. I'm no longer using TinyMCE so it won't be something I'll be following up but for thoes who still do use TinyMCE this would be very helpful.

#4

stevemagruder - July 2, 2008 - 19:14

In terms of adding separators, the code by markus_petrux didn't help me.

However, today, I came up with a kludge for adding separators to button rows...

In \modules\tinymce\tinymce\jscripts\tiny_mce\tiny_mce_src.js, search for

        case "separator":

After this add:

        case "separator2":
        case "separator3":
        case "separator4":
        case "separator5":

Basically, what I'm doing here is adding synonyms for "separator". Also apply the above update to tiny_mce.js in the same directory.

Now, in \modules\tinymce\plugin_reg.php, for each button row, add "separator", "separator2", "separator3", etc. like you would buttons in between the other buttons you want separators between. Make sure you don't use the same separator synonym twice in the same row.

Last, in the Drupal TinyMCE module configuration, check all the separator synonym "buttons" you used in plugin_reg.php.

This works for me. Please feel free to follow up with questions if the above doesn't work for you.

 
 

Drupal is a registered trademark of Dries Buytaert.