Skip to content

CKeditor5

For "@_sh/strapi-plugin-ckeditor", you need to add ckeditor.ts in apps/cms/config to enable the “Open in a new tab” functionality for links.

apps/web/config/ckeditor.ts
const CKEConfig = () => ({
presets: {
custom: {
field: {
key: 'custom',
value: 'custom',
metadatas: {
intlLabel: {
id: 'ckeditor5.preset.custom.label',
defaultMessage: 'Custom version',
},
},
},
editorConfig: {
/* You can find all available built-in plugins
in the admin/src/components/Input/CKEditor/configs/base.js */
plugins: [
globalThis.SH_CKE.Autoformat,
globalThis.SH_CKE.Bold,
globalThis.SH_CKE.Italic,
globalThis.SH_CKE.Essentials,
globalThis.SH_CKE.Heading,
globalThis.SH_CKE.Image,
globalThis.SH_CKE.ImageCaption,
globalThis.SH_CKE.ImageStyle,
globalThis.SH_CKE.ImageToolbar,
globalThis.SH_CKE.ImageUpload,
globalThis.SH_CKE.MediaEmbed,
globalThis.SH_CKE.Indent,
globalThis.SH_CKE.Link,
globalThis.SH_CKE.List,
globalThis.SH_CKE.Paragraph,
globalThis.SH_CKE.PasteFromOffice,
globalThis.SH_CKE.Table,
globalThis.SH_CKE.TableToolbar,
globalThis.SH_CKE.TableColumnResize,
globalThis.SH_CKE.TableCaption,
globalThis.SH_CKE.StrapiMediaLib,
globalThis.SH_CKE.StrapiUploadAdapter,
globalThis.SH_CKE.SourceEditing,
],
/* By default, the language of the plugin's UI will be chosen
based on the language defined in this config file
or on the preferred language from the strapi's user config
and if both of them are not set then 'en' will be used as a fallback.
( language.ui -> preferred language -> 'en' ) */
/* For content it will chose the language based on i18n (if! ignorei18n)
or on language.content property defined here
and it will use UI language as a fallback.
ignorei18n ? language.content : i18n; -> language.ui */
language: {
// ignorei18n: true,
// ui:'he',
// content:'he'
},
toolbar: [
'heading',
'paragraph',
'heading2',
'heading3',
'heading4',
'|',
'bold',
'italic',
'underline',
'fontSize',
'removeFormat',
'|',
'bulletedList',
,
'numberedList',
'|',
'StrapiMediaLib',
'MediaEmbed',
'blockQuote',
'link',
'|',
'subscript',
'superscript',
'|',
'fullScreen',
'undo',
'redo',
'SourceEditing',
],
link: {
decorators: {
isExternal: {
mode: 'manual',
label: 'Open in a new tab',
attributes: {
target: '_blank',
},
},
},
},
heading: {
options: [
{ model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
{ model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' },
{ model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' },
{ model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' },
{ model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' },
],
},
image: {
toolbar: ['imageStyle:inline', 'imageStyle:block', 'imageStyle:side', '|', 'toggleImageCaption', 'imageTextAlternative'],
},
table: {
contentToolbar: ['tableColumn', 'tableRow', 'mergeTableCells', '|', 'toggleTableCaption'],
},
},
},
},
});