grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

replacing richtexteditor to ckeditor

Open NorthstarTech opened this issue 9 years ago • 6 comments

I am replacing richtexteditor to ckeditor in grapesjs but its not working. Richtexteditor is still showing. How should I resolve this? My code is: editor.setCustomRte({ enable: function(el, rte) { rte = new CKEDITOR.inline(el, { toolbar: [{ attributes: { "class": "fa fa-image" }, command: "open-dialog" } ]
}); return rte; }, });

I also added these scripts,

NorthstarTech avatar Nov 28 '17 13:11 NorthstarTech

Hi @NorthstarTech,

I see that your code is including the grapesjs-plugin-ckeditor.js file. Are you also including that plugin when calling grapesjs.init() as shown here?

ryandeba avatar Nov 28 '17 14:11 ryandeba

yes I also added the plugin on grapesjs.init() but not working. It gives the error shown below. error

NorthstarTech avatar Nov 28 '17 14:11 NorthstarTech

I'm not super familiar with the ckeditor plugin, but it does appear to that it is expecting the sharedspace ckeditor plugin (see here). I think you just need to be sure and include that plugin in your CKEditor configuration. Here's a link to that plugin, but I bet you could also do a custom build of CKEditor through their website and choose to include that from the Available Plugins list.

ryandeba avatar Nov 28 '17 14:11 ryandeba

Thanks alot, I added the sharedspace ckeditor plugins and now it is displaying default toolbar. I want to use my own toolbar, I made a separate file of config.js and add it as a customconfigfile. But its not working. How should I resolve this. Here is my code. var editor = grapesjs.init({ height: '100%', noticeOnUnload: 0, storageManager:{autoload: 0}, container : '#gjs', fromElement: true, plugins: ['gjs-mjml','gjs-plugin-ckeditor'], pluginsOpts: { 'gjs-plugin-ckeditor': { position: 'center', option: { customConfig: 'config_gjs.js', } } } });

NorthstarTech avatar Nov 29 '17 12:11 NorthstarTech

@NorthstarTech never tried with separate file (check the net console, probably your path is wrong) so I recommend using inline configs

artf avatar Nov 30 '17 13:11 artf

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Sep 18 '19 06:09 lock[bot]