1

I'm experimenting with all the CKEditor 5 config options and I like how the docs have the image resize (https://ckeditor.com/docs/ckeditor5/latest/features/images/images-overview.html#image-contextual-toolbar)

CKEditor docs

Using the Image Config docs (https://ckeditor.com/docs/ckeditor5/latest/api/module_image_imageconfig-ImageConfig.html) my config is now:

{
  "image": {
    "resizeOptions": [
      {
        "icon": "original",
        "label": "Original size",
        "name": "resizeImage:original",
        "value": null
      },
      {
        "icon": "small",
        "label": "100px",
        "name": "resizeImage:100",
        "value": "100"
      },
      {
        "icon": "medium",
        "label": "200px",
        "name": "resizeImage:200",
        "value": "200"
      }
    ],
    "resizeUnit": "px",
    "toolbar": [
      "toggleImageCaption",
      "imageTextAlternative",
      "|",
      "resizeImage:100",
      "resizeImage:200",
      "resizeImage:original",
      "|",
      "linkImage"
    ]
  }
} 

I have the other toolbar buttons but not the image resize buttons:

my image CKEditor image toolbar

It doesn't even have the extra separator. Have I typo'ed something?

1

2 Answers 2

2

try like this in this post on ckeditor github .. . https://github.com/craftcms/ckeditor/discussions/120

1
  • That link doesn't have any info about image resize. When I try that config I don't get "transformImage". Nov 6, 2023 at 16:53
1

Looks like Craft had the answer all along https://github.com/craftcms/ckeditor/discussions/94#discussioncomment-5920028

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.