How can I remove some of the Redactor toolbar buttons?

AndyB

Well-known member
How can I remove some of the Redactor toolbar buttons? For example I would like to remove the Text color, Font Size and Font Family buttons.

Thank you.
 

Matthew Hawley

Well-known member
Go to the editor_js_setup and look at the list under RELANG.xf = {

I'm not %100 percent sure if this will work, but doesn't hurt to give it a try. :)
 

AndyB

Well-known member
I tried editing the editor_js_setup template but it doesn't remove the toolbar buttons.
 

AndyB

Well-known member
Okay figured it out. Edit the following file:

/js/redactor/redactor.js

For example to remove the Text Color button, remove the following code found on line #546

Code:
        fontcolor:
         {
           title: RLANG.fontcolor,
           func: 'show'
         },
 

Andy.N

Well-known member
Okay figured it out. Edit the following file:

/js/redactor/redactor.js

For example to remove the Text Color button, remove the following code found on line #546

Code:
        fontcolor:
         {
           title: RLANG.fontcolor,
           func: 'show'
         },
But it will get rewritten the next time you update xF, right?
 

AndyB

Well-known member
But it will get rewritten the next time you update xF, right?
Correct. Anytime you modify the code directly you always want to carefully document the changes so that when you upgrade you can repeat the changes.
 

AndyB

Well-known member
I found a better solution to remove the three font buttons.

1) Rename /js/xenforo/bb_code_edit.js to /js/xenforo/bb_code_edit_original.js
2) Copy /js/xenforo/full/bb_code_edit.js to /js/xenforo/bb_code_edit.js
3) Edit /js/xenforo/bb_code_edit.js and comment out the following starting on line #57

Code:
      /*if (!bC || bC.extended)
       {
         buttons.push(['fontcolor', 'fontsize', 'fontfamily']);
       }*/
 

Jeremy

Well-known member
That change will also need reapplied on every upgrade, as well as merging in any updates.
 
Top