GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.38k stars 4.06k forks source link

replacing richtexteditor to ckeditor #579

Closed NorthstarTech closed 6 years ago

NorthstarTech commented 6 years ago

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,

ryandeba commented 6 years ago

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?

NorthstarTech commented 6 years ago

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

ryandeba commented 6 years ago

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.

NorthstarTech commented 6 years ago

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', } } } });

artf commented 6 years ago

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

lock[bot] commented 5 years ago

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.