{% import '_includes/forms.twig' as forms %} {% import 'codeeditor/codeEditor.twig' as codeEditor %} {% set readOnly = readOnly ?? false %} {% set baseMonacoOptions = { tabSize: 2, showUnused: false, } %} {% if readOnly %} {% set baseMonacoOptions = baseMonacoOptions|merge({ domReadOnly: true, readOnly: true }) %} {% endif %} {% set wrapperClasses = ['monaco-editor-background-frame'] %} {% set baseCodeEditorOptions = {} %} {% embed '_includes/forms/field.twig' with { label: 'Toolbar'|t('ckeditor'), instructions: 'Drag toolbar items into the editor.'|t('ckeditor'), id: 'toolbar', field, errors: field.getErrors('toolbar'), data: {'error-key': 'toolbar'}, } %} {% block input %}
{{ 'Choose a JS/JSON file within `config/ckeditor/`.'|t('ckeditor')|md(inlineOnly=true) }}
{{ forms.select({ id: 'config-options-file', name: 'jsFile', options: jsFileOptions, value: field.jsFile, }) }} {% else %} {% endif %} {% endtag %} {% endblock %} {% endembed %} {% embed '_includes/forms/field.twig' with { label: 'Custom Styles'|t('ckeditor'), instructions: 'Define CSS styles that should be registered for editors, such as [style classes]({url}).'|t('ckeditor', { url: 'https://ckeditor.com/docs/ckeditor5/latest/features/style.html', }), id: 'css', field, errors: [ ...field.getErrors('css'), ...field.getErrors('cssFile'), ], data: {'error-key': 'css'}, } %} {% block input %} {% import 'codeeditor/codeEditor.twig' as codeEditor %} {% import '_includes/forms.twig' as forms %}{{ 'Choose a CSS file within `config/ckeditor/`.'|t('ckeditor')|md(inlineOnly=true) }}
{{ forms.select({ id: 'css-options-file', name: 'cssFile', options: cssFileOptions, value: field.cssFile, }) }} {% else %} {% endif %} {% endtag %} {% endblock %} {% endembed %} {{ forms.lightswitchField({ label: "Purify HTML"|t('ckeditor'), instructions: 'Removes any potentially-malicious code on save, by running the submitted data through {link}.'|t('ckeditor', { link: 'HTML Purifier', }), warning: 'Disable this at your own risk!'|t('ckeditor'), id: 'purify-html', name: 'purifyHtml', on: field.purifyHtml, toggle: 'purifier-config-container', disabled: readOnly, }) }}