【问题标题】:Django CKEditor Restrict Image PropertiesDjango CKEditor 限制图像属性
【发布时间】:2021-02-04 04:08:44
【问题描述】:

目前我正在使用 CKeditor 来让用户写出好看的帖子。现在,当我尝试集成图像选项时,我只希望用户上传图像,当我单击它显示的图像符号时:ImageInfo(让用户从服务器文件夹中选择图像),链接用于网络图像,上传打开文件浏览器并让用户选择自己的,高级,我不知道。

我只希望用户能够从他的计算机上传图像。如何停用其他属性? 这是我在 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'
    }
}

【问题讨论】:

    标签: django ckeditor django-ckeditor


    【解决方案1】:

    您可以使用removeDialogTabs 删除标签,如下所述:

    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',
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-27
      • 2019-05-18
      • 1970-01-01
      相关资源
      最近更新 更多