Question

In TinyMCE WYSIWYG Editor, There is a third row which includes icons such as Insert horizontal ruler, Remove formatting, Subscript, Superscript, etc. These icons seem to come by default with the editor as there seems to be no way of changing them. .

TinyMCE... http://img821.imageshack.us/img821/6431/tinymce.png

I would like to be able to choose which one I want to display, for example, let's say I only want the Subscript and Superscript icons (not the other ones)

Does anybody know how I can do this?

Thank you

Was it helpful?

Solution

You can do this by using the theme_advanced_buttons option for TinyMCE :)

Here's a link to TinyMCE documentation:

Button Themes

I happen to have an example using TinyMCE's jQuery plugin but you can do it with "stock" tinyMCE as well:

$('#bio').tinymce({
    script_url : '/js/tiny_mce/tiny_mce.js',
    theme : 'advanced',
    theme_advanced_buttons1: 'bold,italic,underline,|,undo,redo,|,bullist,numlist',
    theme_advanced_buttons2: '',
    theme_advanced_buttons3: '',
    theme_advanced_buttons4: '',
    theme_advanced_toolbar_location: 'bottom',
    theme_advanced_toolbar_align: 'center',
});

In this particular case, I'm actually disabling the other toolbars -- but you can put whatever you want. The buttons it understands are documented here:

TinyMCE Button Documentation

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top