Django CKEditor Restrict Image Properties

476 views Asked by At

Currently im using CKeditor to allow user to write nice looking posts. Now when i try to integrate the image option, I only want the user to upload images, when i click on the image symbol it shows: ImageInfo (lets the user choose an image from server folder), Link for a web image, Upload to open a file browser and let user choose his own, and Advanced, which i do not know about.

I only want the user to be able to upload images from his computer. How do i deactivate the other properties? here is my config in settings.py:

CKEDITOR_CONFIGS = {
    'default': {
        'width': '150%',
        'toolbar': 'Custom',
        # Specify Custom Shit - GPL License -
        'toolbar_Custom': [
            ['Bold', 'Italic', 'Underline', '-', 'Image', 'Link', 'CodeSnippet', '-', 'NumberedList', 'BulletedList', 'HorizontalRule', '-', 'Undo', 'Redo'],
        ], 'extraPlugins': 'codesnippet'
    }
}
1

There are 1 answers

0
AsBaZa On

You can remove tabs using removeDialogTabs as mentioned here:

https://stackoverflow.com/a/47260647/14507752

CKEDITOR_CONFIGS = {
    'default': {
        'width': '150%',
        'toolbar': 'Custom',
        # Specify Custom Shit - GPL License -
        'toolbar_Custom': [
            ['Bold', 'Italic', 'Underline', '-', 'Image', 'Link', 'CodeSnippet', '-', 'NumberedList', 'BulletedList', 'HorizontalRule', '-', 'Undo', 'Redo'],
        ], 'extraPlugins': 'codesnippet'
        # Remove Dialog Tabs
        'removeDialogTabs': 'image:advanced;image:Link',
    }
}