5

This is my code:

http://jsfiddle.net/KfVJK/

This is the code to add redactor:

$(document).ready(
            function()
            {
                $('#redactor_content').redactor();
            }
        );​

I want to limit the number of buttons on the toolbar. For example only have basic formatting like bold, italic, etc.

How can I remove buttons from the toolbar?

Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252
Jimmy
  • 12,087
  • 28
  • 102
  • 192

2 Answers2

8

Use the buttons setting:

var buttons = ['formatting', '|', 'bold', 'italic'];

$('#redactor').redactor({buttons: buttons});

This is extract from documentation:

By default, this setting contains the following array of toolbar's buttons:

['html', '|', 'formatting', '|', 'bold', 'italic', 'deleted', '|', 
'unorderedlist', 'orderedlist', 'outdent', 'indent', '|',
'image', 'video', 'file', 'table', 'link', '|',
'fontcolor', 'backcolor', '|', 'alignment', '|', 'horizontalrule']

// additional buttons
// 'underline', 'alignleft', 'aligncenter', 'alignright', 'justify'
// If you wish to set your own array, set it in this option:

$('#redactor').redactor({
    buttons: ['html', '|', 'formatting', '|', 'bold', 'italic'] 
});
Michal Klouda
  • 14,263
  • 7
  • 53
  • 77
7

After go through their docs, I would suggest you to setting your button as following:

$('#redactor').redactor({
    buttons: ['formatting', '|', 'bold', 'italic'] 
});

DEMO: http://jsfiddle.net/KfVJK/3/

Eli
  • 14,779
  • 5
  • 59
  • 77