strapi-plugin-ckeditor icon indicating copy to clipboard operation
strapi-plugin-ckeditor copied to clipboard

Add support for a custom configuration

Open hexionaut opened this issue 2 years ago • 6 comments

Hi !

Is there a way to enable / disable some features of the editor ?

Thanks for helping !

hexionaut avatar Jan 11 '23 19:01 hexionaut

Hi!

It looks that currently it is not possible. I tried. Follow https://github.com/ckeditor/strapi-plugin-ckeditor#-contributing to adjust the config to your needs. This plugin would be greater if it was possible to create custom configuration...

Przemek625 avatar Jan 12 '23 10:01 Przemek625

Oh wait, there's no entry for this plugin in config/plugins.js, so probably won't work :(

@anthonyhexium @Przemek625

Forgive me if I am wrong, which I probably am, but is it not possible to modify a plugin by extending it via the Strapi docs "Plugin Extension"?

I'm kind of talking out of my butt right now, because I don't really know how to do it, but just thought I'd chime in because I'm trying to extend the plugin right now. Which will hopefully work :)

prestonator avatar Mar 08 '23 21:03 prestonator

@prestonator If I'm not mistaking, Strapi only supports extending the server part of a plugin. The problem in this plugin is that the configuration is in the React front part and is hard-coded. I think we have no choice but change this plugin's code to make the hard-coded part more configurable.

marob avatar Mar 09 '23 09:03 marob

@anthonyhexium You can use configurator.js to affect custom configuration and rebuild strapi to take effects.

twog93 avatar May 16 '23 08:05 twog93

Would you guys accept a PR which allows the configuration object to be overwritten? Kinda the same way as possible in https://github.com/nshenderov/strapi-plugin-ckeditor

If so; any requirements you might have as to how this is implemented?

boazpoolman avatar May 13 '24 08:05 boazpoolman

The ability to overwrite parts of the configuration would be great. I am still on the fence wether to switch from TinyMCE to CKEditor, and this and not being able to do source editing are the main reasons.

For example adding a lead element to the heading options:

config: {
   rich: {
      heading: {
          options: [
              { model: 'lead', view: 'p', title: 'Lead', class: 'lead' },
          ]
      }
   }
}

douwepausma avatar Jun 27 '24 08:06 douwepausma