fontcolor redactor plugin for Perch V3 HOW TO MAKE IT WORK?

  • I have got the fontcolor.js in place at addons\plugins\editors\redactor-plugins


    what do I need in config.js at addons\plugins\editors - does anyone have a full example please?


    I have found code I thought was correct but it merely removed the redactor toolbar altogether ... which makes me think the code was for V2 perch


    any help gratefully accepted

  • Hi Hussein,


    I am still really struggling with this and for some reason none of this works for my application, or it gives me some odd behavior, i.e. I need to have both an instance of 'redactor' and 'redactor2' in the template. I've had different elements working, but nothing consistently, so I have built a quick test page to see if I can get to the bottom of what is happening.


    To start from the beginning, so I leave zero stones un-turned, I am using Perch v3.1.6.


    I have added define('PERCH_CUSTOM_EDITOR_CONFIGS', true); into my config file.


    Now the more I have looked at things, the more confused I am. Perch v3 ships with two versions of redactor in the plugins folder, namely redactor and redactor 2.


    There seems to be some chatter that the 'default' version of redactor that is now shipped with Perch v3 is redactor v3 or is this just nonsense ?


    In my template, I am currently calling a test textarea with: <perch:content id="testredactor" type="textarea" label="Redactor" html editor="redactor">


    Now, the first thing I want to get into my head is that, as I want to expand/reduce the functionality of different configs of redactor, is it best to use editor="redactor" or editor="redactor2".


    For example, in previous trials, I have managed to get the plugin 'counter' working for redactor, but it does not display if I change the editor to redactor2.


    Anyway, skipping ahead. After reading your blog (link you provided above), I have tried to get the following config.js file working. Again, for completeness, this file is sitting at the location /addons/plugins/editors/config.js


    and I have downloaded and added redactor plugins from: https://imperavi.com/redactor/plugins/ which are located at: /addons/plugins/editors/redactor-plugins/


    Using your code in the blog for the plugin fontcolor, I have a config.js file of:


    All fine so far.


    But, if I want to add another plugin, such as 'counter', I download the appropriate js file from imperavi and then I would write something like:


    Which is not working because I am pretty sure I have called the load function incorrectly.


    The thing is, if I look at the documentation and other posts wrt config files, they all seem to write things differently and I cannot get an understanding, or consistency on what is happening.


    Also, do some plugins not work with redactor or redactor2 ? As you an see, I am completely confused ! and any help would be greatly appreciated.


    I've spent hours going through different posts, different types of config and still cannot get any clarity on which redactor to use, to enable the plugins to work and how best to wrote the config file.


    Thanks,


    Andy

  • Yes, doing some more testing, the first config file I posted (with just fontcolor), if I swap this out to say table, redactor does not show this plugin.


    Changing my test template from redactor to redactor2 <perch:content id="testredactor" type="textarea" label="Redactor" html editor="redactor"> does display the table button, but if I keep redactor2 and change the plugin back to fontcolor, it does not display it !


    As such, it seems that certain plugins work for redactor and some for redactor2 that is shipped with Perch. As such, am I now correct in thinking that I will need to purchase whatever the latest redactor is and instal it into my PErch set-up as another further item, or probably remove the plugins redactor and redactor2 and instal this purchased item.


    However, I thought that Perch v3 had the latest redactor within it ?


    Absolutely confused and it's a day of banging my head against the wall.

    Would really appreciate any feedback.


    Thanks,


    Andy

  • Thanks Clive, this works perfectly !!!!


    Somehow, I just managed to get myself in a tizz with everything and looking at some of my previous efforts (and some of the content out there), it is close, but no cigar.


    Cannot thank you enough for this, wish I had found it 48hrs ago as I might have had a bit of sanity left !!