This tutorials is outdated since it is for Strapi v3. We redirect you to the part of our documentation concerning the creation of a new WYSIWYG field in the admin panel
If you're a Strapi user seeking a more powerful and intuitive editor, changing the default WYSIWYG to the Toast UI Editor could significantly enhance your content creation workflow. Toast UI Editor offers real-time preview and a host of features that can streamline your editing process.
To improve your content editing experience in Strapi, you can replace the default WYSIWYG editor with the Toast UI Editor. This guide walks you through integrating the Toast UI Editor, configuring it for compatibility, and troubleshooting common issues.
First, you'll need to install the Toast UI Editor plugin for Strapi. Run the following command:
npm install strapi-plugin-toastui-editor
Alternatively, if you're using yarn:
yarn add strapi-plugin-toastui-editor
Next, enable the plugin by adding it to your config/plugins.js
file:
1module.exports = {
2 // ...
3 'toastui-editor': {
4 enabled: true,
5 resolve: './node_modules/strapi-plugin-toastui-editor',
6 },
7 // ...
8};
If the plugins.js
file doesn't exist, create it within the config
directory of your Strapi project. This configuration tells Strapi to include the Toast UI Editor plugin when it starts.
After making the changes, restart your Strapi server to load the new plugin:
npm run build
npm run develop
or
yarn build
yarn develop
You should now be able to edit your Rich Text content using the Toast UI Editor!
To ensure compatibility and tailor the editor to your needs, you can customize various settings of the Toast UI Editor. For example, you may want to adjust the toolbar items, styling, or functionalities.
To customize the editor toolbar, modify the settings in your config/plugins.js
or create a separate configuration file as needed:
1module.exports = {
2 // ...
3 'toastui-editor': {
4 enabled: true,
5 resolve: './node_modules/strapi-plugin-toastui-editor',
6 config: {
7 editor: {
8 toolbarItems: [
9 'heading',
10 'bold',
11 'italic',
12 'strike',
13 'divider',
14 'hr',
15 'quote',
16 'divider',
17 'ul',
18 'ol',
19 'task',
20 'indent',
21 'outdent',
22 'divider',
23 'table',
24 'link',
25 'image',
26 'divider',
27 'code',
28 'codeblock',
29 ],
30 },
31 },
32 },
33 // ...
34};
Ensure that the configurations align with both Strapi's and Toast UI Editor's documentation.
If you encounter issues during the integration, here are some troubleshooting steps:
Clear Cache: Rebuild the admin panel to clear any cached files:
npm run build
or
yarn build
Plugin Conflicts: Disable other editor plugins that might conflict with the Toast UI Editor.
For persistent issues, consult the Strapi community forums or the plugin's documentation for additional support.
One of the strengths of the Toast UI Editor is its flexibility and customization options. You can tailor the editor to suit your content creation needs.
Customize the toolbar to include only the tools your content creators need. Adjust your configuration accordingly:
1module.exports = {
2 // ...
3 'toastui-editor': {
4 // ...
5 config: {
6 editor: {
7 toolbarItems: [
8 'heading',
9 'bold',
10 'italic',
11 'underline',
12 'strike',
13 'divider',
14 'link',
15 'image',
16 'table',
17 'code',
18 'codeblock',
19 ],
20 },
21 },
22 },
23 // ...
24};
If you require additional functionality, you can add plugins or extensions to the editor. This process might involve installing additional packages and updating your configurations.
For example, to add a color picker plugin:
Install the plugin:
npm install @toast-ui/editor-plugin-color-syntax
Import and configure the plugin in your config/plugins.js
:
1const colorSyntax = require('@toast-ui/editor-plugin-color-syntax');
2
3module.exports = {
4 // ...
5 'toastui-editor': {
6 // ...
7 config: {
8 editor: {
9 plugins: [colorSyntax],
10 },
11 },
12 },
13 // ...
14};
The Toast UI Editor can integrate with Strapi's Media Library, allowing you to easily insert images and media into your content. Ensure that the editor's settings are configured to interact seamlessly with the Media Library, and that you have appropriate permissions set up.
While integrating the Toast UI Editor can enhance your content creation process, you may face some challenges. Being aware of these obstacles and their solutions can help ensure a smooth integration.
Compatibility Issues: Conflicts can arise if the editor's configurations don't align with Strapi's content types. To overcome this, customize the editor settings to match your content structure. Refer to the documentation of both Strapi and Toast UI Editor for guidance.
Incorporating Custom Plugins: Integrating additional plugins requires careful setup. Test each plugin individually in a development environment to identify any compatibility issues before deploying them in your production environment.
Configuration errors might prevent the editor from loading correctly or cause it to malfunction. To resolve them:
Being meticulous with your configuration can save time and prevent frustration, leading to a smoother integration process.
Changing the default WYSIWYG editor to Toast UI Editor can significantly affect your content management workflow in Strapi. It's essential to assess how this change influences content creation efficiency and overall user satisfaction.
Switching editors may streamline your workflow by introducing new features or simplifying existing tasks. Observe how the new editor handles:
Monitor the time it takes to create and edit content before and after the switch to quantify any improvements in efficiency.
After implementing the Toast UI Editor, gather feedback from your team members who use it daily. Their insights can reveal benefits or challenges that aren't immediately obvious. Encourage open discussions about their experiences to identify any issues that need addressing. This feedback is invaluable for making informed decisions about further adjustments or training needs.
Implementing the Toast UI Editor in Strapi offers several advantages:
By leveraging these benefits, you can improve the efficiency and satisfaction of your content management workflows.
When choosing a WYSIWYG editor for Strapi, it's beneficial to compare the options available.
Both Toast UI Editor and CKEditor are popular choices. Here's a brief comparison:
Select an editor that aligns with your specific requirements:
By carefully evaluating these factors, you can choose the editor that best fits your project's needs.
Integrating the Toast UI Editor into your Strapi project can significantly enhance your content creation capabilities. By following the steps outlined in this guide, you can successfully replace the default WYSIWYG editor, customize it to suit your needs, and address any challenges that arise.
Remember to:
By embracing advanced tools like the Toast UI Editor, you empower your content team to produce higher-quality content more efficiently.
Get started with Strapi by creating a project, using a starter, or trying our instant live demo. If you have any questions, consult our forum where we are always ready to help.
See you soon!
Maxime started to code in 2015 and quickly joined the Growth team of Strapi. He particularly likes to create useful content for the awesome Strapi community. Send him a meme on Twitter to make his day: @MaxCastres