Configuration ============= Register Configuration ----------------------- Except for ``CKEDITOR_SERVE_LOCAL`` and ``CKEDITOR_PKG_TYPE``, when you use other configuration variables, you have to call ``ckeditor.config()`` in the template to make them register with CKEditor: .. code-block:: jinja
... {{ ckeditor.config() }} When using Flask-WTF/WTForms, you have to pass the field name as ``name`` in ``ckeditor.config()``, for example: .. code-block:: jinja ... {{ ckeditor.config(name='description') }} When using Flask-Admin, the name value will be the field name you overwritten with ``form_overrides = dict(the_field_name=CKEditorField)``. For example: .. code-block:: jinja {% extends 'admin/model/edit.html' %} {% block tail %} {{ super() }} ... {{ ckeditor.config(name='the_field_name') }} {% endblock %} If you create the CKEditor through ``ckeditor.create()``, the default value (``name='ckeditor'``) will be used. Available Configuration ------------------------ The configuration options available are listed below: =============================== ======================= ========================================================================================================================================================================= Name Default Value Info =============================== ======================= ========================================================================================================================================================================= CKEDITOR_SERVE_LOCAL ``False`` Flag used to enable serving resources from local when use ``ckeditor.load()``, default is to retrieve from CDN. CKEDITOR_PKG_TYPE ``'standard'`` The package type of CKEditor, one of ``basic``, ``standard``, ``full``, ``standard-all`` and ``full-all``. The last two options only available from CDN. CKEDITOR_LANGUAGE ``None`` The lang code string to set UI language in ISO 639 format, for example: ``zh``, ``en``, ``jp`` etc. Leave it unset to enable auto detection by user's browser setting. CKEDITOR_HEIGHT CKEditor default The height of CKEditor textarea, in pixel. CKEDITOR_WIDTH CKEditor default The width of CKEditor textarea, in pixel. CKEDITOR_FILE_UPLOADER ``None`` The URL or endpoint that handles file upload. CKEDITOR_FILE_BROWSER ``None`` The URL or endpoint that handles file browser. CKEDITOR_ENABLE_CODESNIPPET ``False`` Flag used to enable codesnippet plugin, the plugin must be installed (included in built-in resources). CKEDITOR_CODE_THEME ``'monokai_sublime'`` Set code snippet highlight theme when codesnippet plugin was enabled. CKEDITOR_EXTRA_PLUGINS ``[]`` A list of extra plugins used in CKEditor, the plugins must be installed. CKEDITOR_ENABLE_CSRF ``False`` Flag used to enable CSRF protection for image uploading, see :doc:`/plugins` for more details. CKEDITOR_UPLOAD_ERROR_MESSAGE ``'Upload failed.'`` Default error message for failed upload. =============================== ======================= ========================================================================================================================================================================= Custom Configuration String ---------------------------- In addition, you can pass custom settings with ``custom_config`` argument: .. code-block:: jinja {{ ckeditor.config(custom_config="uiColor: '#9AB8F3'") }} Keep it mind that the proper syntax for each option is ``configuration name : configuration value``. You can use comma to separate multiple key-value pairs. See the list of available configuration settings on `CKEditor documentation