In Strapi 4. How to change Wysiwyg editor to CKEditor?

Viewed 2036

After the release of Strapi 4, the CKEditor library for Strapi is no longer supported. And when trying to follow the documentation it is also not very clear if it is with component injection or some other procedure.

Strapi 4 Docs

WYSIWYG editor To change the current WYSIWYG, you can either install a third-party plugin, or take advantage of the bootstrap lifecycle (see Admin Panel API).

In the Strapi 4 presentation, Rémi de Juvigny, uses component injection, but it is only for the sidebar, not for changing any specific content-type collection.

Has anyone made any progress with this new version of Strapi and CKEditor?

1 Answers

On Strapi V4 Now we should use:

app.addFields({type:'wysiwyg',Component:Editor})

insted of

strapi.registerFields({type:'wysiwyg',Component:Editor})

Eg.

import pluginPkg from '../../package.json';
import pluginId from './pluginId';
import Initializer from './components/Initializer';
import Editor from './components/Editor';
const name = pluginPkg.strapi.name;

export default {
  register(app) {
    
    app.registerPlugin({
      id: pluginId,
      initializer: Initializer,
      isReady: false,
      name,
    });

    app.addFields({type:'wysiwyg',Component:Editor})
  }
  
};
Related