django-ckeditor-5 icon indicating copy to clipboard operation
django-ckeditor-5 copied to clipboard

imagetoolbar not show when select an image

Open juanbits opened this issue 11 months ago • 11 comments

Hi, i have the next in my settings:

CKEDITOR_5_CONFIGS = {
    "default": {
        "toolbar": [
            "bold",
            "italic",
            "imageUpload",
        ],
        "image": {
            "toolbar": [
                "imageTextAlternative",
                "|",
                "imageStyle:alignLeft",
                "imageStyle:alignRight",
                "imageStyle:alignCenter",
                "imageStyle:side",
                "|",
            ],
            "styles": [
                "full",
                "side",
                "alignLeft",
                "alignRight",
                "alignCenter",
            ],
        },
    },
}

i see on the ckeditor 5 demo ( https://ckeditor.com/docs/ckeditor5/latest/examples/builds-custom/full-featured-editor.html ) when i upload an image and selects the image object on the canvas a image toolbar appears. image

but with this django integration when i select the image object in the canvas, not appears that toolbar and i dont have an error or message in the browser console. any idea? image

thanks in advance

juanbits avatar Mar 07 '24 01:03 juanbits

Change your configuration to match the example in the docs:

CKEDITOR_5_CONFIGS = {
    "default": {
        "toolbar": [
            "bold",
            "italic",
            "imageUpload",
        ],
        "image": {
            "toolbar": [
                "imageTextAlternative",
                "toggleImageCaption",
                "|",
                "imageStyle:inline",
                "imageStyle:wrapText",
                "imageStyle:breakText" "|",
                "resizeImage",
                "|",
                "ckboxImageEdit",
            ],
            "styles": [
                "full",
                "side",
                "alignLeft",
                "alignRight",
                "alignCenter",
            ],
        },
    },
}

jgwillard avatar Mar 10 '24 20:03 jgwillard

@jgwillard with the next config:

"image": {
            "toolbar": [
                "imageTextAlternative",
                "toggleImageCaption",
                "|",
                "imageStyle:inline",
                "imageStyle:wrapText",
                "imageStyle:breakText",
                "|",
                "resizeImage",
                "|",
                "ckboxImageEdit",
            ],
            "styles": [
                "full",
                "side",
                "alignLeft",
                "alignRight",
                "alignCenter",
            ],
           ...

i got the error in console: toolbarview-item-unavailable {item: 'ckboxImageEdit'}item: "ckboxImageEdit"[[Prototype]]: Object

juanbits avatar Mar 11 '24 15:03 juanbits

Looks like that's a plugin that you would have to install separately... I'm not sure how to do that but if you remove that item the rest should work as expected.

jgwillard avatar Mar 11 '24 15:03 jgwillard

@jgwillard i added the plugin and other required (according to https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-ckbox/docs/features/ckbox.md ) bit continut without work

juanbits avatar Mar 11 '24 19:03 juanbits

i think ckbox is another plugin not required for the image toolbar

juanbits avatar Mar 11 '24 22:03 juanbits

Yes, if you remove that string from the config everything else in the toolbar should display as expected.

jgwillard avatar Mar 12 '24 13:03 jgwillard

so i dont understand why you said: include ckboxImageEdit in the config if no is required for ?

juanbits avatar Mar 12 '24 14:03 juanbits

ckbox is a commercial plugin which requires a license, so unless you bought one this is probably not the right thing to add?

goapunk avatar Mar 12 '24 15:03 goapunk

the toolbar appears correctly in the example blog application, maybe it helps if you can share your project @juanbits ?

goapunk avatar Mar 12 '24 15:03 goapunk

@goapunk i make a double check and i see the toolbar appears on the admin image

but no in editors inside modals: image

juanbits avatar Mar 12 '24 17:03 juanbits

@juanbits another guess could be that you have some custom css which makes the toolbar invisible by accident, that could explain why it appears in the admin but not in the modals. Can you find the toolbar in the dev tools / inspector? If you can find it maybe check stuff like z-index etc. and see if one is responsible for hidding it.

goapunk avatar Mar 18 '24 08:03 goapunk