{% import '_includes/forms' as forms %} {% set mode = field.editorMode ?? 'combined' %} {{ forms.selectField({ label: 'Editor Mode' | t('vizy'), instructions: 'Select the mode for the editor to use.' | t('vizy'), name: 'editorMode', value: field.editorMode, options: [ { label: 'Blocks & Rich Text' | t('vizy'), value: 'combined' }, { label: 'Rich Text Only' | t('vizy'), value: 'richText' }, { label: 'Blocks Only' | t('vizy'), value: 'blocks' }, ], toggle: true, targetPrefix: '.mode-', errors: field.getErrors('editorMode'), }) }}
{% set configInput %}
{{ forms.select({ name: 'configSelectionMode', options: [ { label: 'Choose a config file' | t('vizy'), value: 'choose' }, { label: 'Enter a custom config' | t('vizy'), value: 'manual' } ], value: field.configSelectionMode, toggle: true, targetPrefix: '.csm-' }) }} {{ forms.select({ id: 'vizyConfig', name: 'vizyConfig', class: ['csm-choose', field.configSelectionMode == 'manual' ? 'hidden'] | filter, options: vizyConfigOptions, value: field.vizyConfig, }) }}
{% endset %} {{ forms.field({ label: 'Editor Config' | t('vizy'), id: 'config', instructions: 'You can save custom editor configs as `.json` files in `config/vizy/`, or you can enter a custom config.' | t('vizy') ~ ' ' ~ 'View available settings' | t('vizy') ~ '', required: true, }, configInput) }} {{ forms.textareaField({ label: 'Custom Editor Config' | t('vizy'), instructions: 'The config must be entered as valid JSON.' | t('vizy'), fieldClass: ['csm-manual', field.configSelectionMode == 'choose' ? 'hidden'] | filter, class: ['code', 'ltr'], name: 'manualConfig', value: field.manualConfig, rows: 10, cols: 50, errors: field.getErrors('manualConfig'), }) }}

{{ 'Define the types of blocks that can be created within this Vizy field, as well as the fields each block type is made up of.' | t('vizy') }}

{% set fieldName = craft.app.view.namespaceInputName('fieldData') %}

{{ forms.textField({ label: 'Initial Rows' | t('vizy'), instructions: 'Set the initial rows for the field. This indirectly controls the height of the field when no content has been added.' | t('vizy'), name: 'initialRows', value: field.initialRows, size: 2, errors: field.getErrors('initialRows'), }) }}
{{ forms.lightswitchField({ label: 'Remove Empty Paragraphs' | t('vizy'), instructions: 'Whether empty paragraphs should be trimmed automatically from field output.' | t('vizy'), name: 'trimEmptyParagraphs', on: field.trimEmptyParagraphs, errors: field.getErrors('trimEmptyParagraphs'), }) }} {{ forms.lightswitchField({ label: 'Plain Text Paste' | t('vizy'), instructions: 'Whether content pasted into the field should always be in plain text.' | t('vizy'), name: 'pasteAsPlainText', on: field.pasteAsPlainText, errors: field.getErrors('pasteAsPlainText'), }) }}
{{ forms.selectField({ label: 'Block Type Picker Behaviour' | t('vizy'), instructions: 'Select the behaviour for picking block types for the field.' | t('vizy'), name: 'blockTypeBehaviour', value: field.blockTypeBehaviour, options: [ { label: 'Click' | t('vizy'), value: 'click' }, { label: 'Hover' | t('vizy'), value: 'hover' }, ], errors: field.getErrors('blockTypeBehaviour'), }) }} {{ forms.textField({ label: 'Min Blocks' | t('vizy'), instructions: 'The minimum number of Vizy blocks the field must have.' | t('vizy'), name: 'minBlocks', value: field.minBlocks, size: 2, errors: field.getErrors('minBlocks'), }) }} {{ forms.textField({ label: 'Max Blocks' | t('vizy'), instructions: 'The maximum number of Vizy blocks the field is allowed to have.' | t('vizy'), name: 'maxBlocks', value: field.maxBlocks, size: 2, errors: field.getErrors('maxlocks'), }) }}
{{ 'Asset Settings' | t('vizy') }}
{% if craft.app.db.isMysql %} {{ 'Advanced' | t('vizy') }} {% endif %}