Forum

Thread tagged as: Question, Redactor

configuring redactor in Perch 3

Previously I used to edit redactor to show / hide buttons as needed. How do I do that now it is part of the core? I see in this thread: https://forum.grabaperch.com/forum/04-09-2017-recommended-way-to-configure-redactor-in-perch-3 you mention to "add a copy under a different name" - what do you mean by that exactly?

Lisa Morena

Lisa Morena 1 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You'd follow the section "Custom configurations for default editors" here: https://docs.grabaperch.com/api/editors/

Yeah, just saw that - it all must have been added since that first thread was posted! Anyway I have it working now, but can't hide the image and link buttons. It says here: https://imperavi.com/redactor/docs/settings/buttons/ to do add buttonsHide, so I did this:

   config.buttons = ['bold','italic'];
   config.buttonsHide = ['image','link'];

But it doesn't hide the image and file upload buttons. Any ideas?

Also, I used to add size="s" etc to the perch template tag and then I would set up different sets of buttons, etc in the Redactor config file - how would I go about this now? Is it still possible?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you trying to hide the Perch image and file buttons? The ones that launch Assets?

Yes, that's right

Drew McLellan

Drew McLellan 2638 points
Perch Support

That's a plugin called perchassets. The individual buttons are perchassets_img and perchassets_file.

Ahhhhh, I see! So do I hide those with config.buttonsHide?

Drew McLellan

Drew McLellan 2638 points
Perch Support

You could try that, or maybe exclude the plugin.

OK, hiding the buttons didn't work. How would I exclude the plugin?

Ahhh, I just tried this and it worked:

config.plugins = [];