How to make TinyMCE in Drupal put icons all on one row

August 29th, 2007

How do I stop the TinyMCE WYSIWYG editor Drupal module from using two rows of icons in the toolbar? Here’s how to configure the plugin so that it puts all the icons into one row…

Overview: The TinyMCE Drupal module separates the toolbar icons into sensible groups, but if you only want a few icons in the TinyMCE toolbar, it doesn’t make sense to have them span two rows.

To change the default toolbar in the Drupal TinyMCE editor to a single line is easy. Your version might look different, but essentially you need to load all of the icons into the array that represents the first line of the toolbar.

1. Open [drupal root]/modules/tinymce/plugin_reg.php.

Change the code from this:


$plugins['default']['theme_advanced_buttons1'] = array(’bold’, ‘italic’, ‘underline’, ’strikethrough’, ‘justifyleft’, ‘justifycenter’, ‘justifyright’, ‘justifyfull’, ‘bullist’, ‘numlist’, ‘outdent’, ‘indent’, ‘undo’, ‘redo’, ‘link’, ‘unlink’, ‘anchor’);
$plugins['default']['theme_advanced_buttons2'] = array(’image’, ‘cleanup’, ‘forecolor’, ‘backcolor’, ’sup’, ’sub’, ‘code’, ‘hr’);
$plugins['default']['theme_advanced_buttons3'] = array(’cut’, ‘copy’, ‘paste’, ‘visualaid’, ‘removeformat’, ‘charmap’, ‘help’);

to this:


$plugins['default']['theme_advanced_buttons1'] = array(’bold’, ‘italic’, ‘underline’, ’strikethrough’, ‘justifyleft’, ‘justifycenter’, ‘justifyright’, ‘justifyfull’, ‘bullist’, ‘numlist’, ‘outdent’, ‘indent’, ‘undo’, ‘redo’, ‘link’, ‘unlink’, ‘anchor’, ‘image’, ‘cleanup’, ‘forecolor’, ‘backcolor’, ’sup’, ’sub’, ‘code’, ‘hr’, ‘cut’, ‘copy’, ‘paste’, ‘visualaid’, ‘removeformat’, ‘charmap’, ‘help’);

One Response to “How to make TinyMCE in Drupal put icons all on one row”

  1. Kamran Zafar Says:

    I searching how to put all icons in one line of tiny mce using drupal 5. Thanks putting this. There one issue in this code is that the single quotes written in array are not syntactically correct. here are they provided in correct form to just copy paste them in your “[drupal root]/modules/tinymce/plugin_reg.php” file.

    Change the code from this: (with correct quotes)
    $plugins['default']['theme_advanced_buttons1'] = array(’bold’, ‘italic’, ‘underline’, ’strikethrough’, ‘justifyleft’, ‘justifycenter’, ‘justifyright’, ‘justifyfull’, ‘bullist’, ‘numlist’, ‘outdent’, ‘indent’, ‘undo’, ‘redo’, ‘link’, ‘unlink’, ‘anchor’);
    $plugins['default']['theme_advanced_buttons2'] = array(’image’, ‘cleanup’, ‘forecolor’, ‘backcolor’, ’sup’, ’sub’, ‘code’, ‘hr’);
    $plugins['default']['theme_advanced_buttons3'] = array(’cut’, ‘copy’, ‘paste’, ‘visualaid’, ‘removeformat’, ‘charmap’, ‘help’);

    To this: (with correct quotes)
    $plugins['default']['theme_advanced_buttons1'] = array(’bold’, ‘italic’, ‘underline’, ’strikethrough’, ‘justifyleft’, ‘justifycenter’, ‘justifyright’, ‘justifyfull’, ‘bullist’, ‘numlist’, ‘outdent’, ‘indent’, ‘undo’, ‘redo’, ‘link’, ‘unlink’, ‘anchor’, ‘image’, ‘cleanup’, ‘forecolor’, ‘backcolor’, ’sup’, ’sub’, ‘code’, ‘hr’, ‘cut’, ‘copy’, ‘paste’, ‘visualaid’, ‘removeformat’, ‘charmap’, ‘help’);

Leave a Reply