craft-codemirror icon indicating copy to clipboard operation
craft-codemirror copied to clipboard

How to use in custom plugins?

Open bertoost opened this issue 6 years ago • 1 comments

Is it possible to use this field in custom plugins? For example;

{% if craft.app.plugins.isPluginEnabled('code-mirror') %}

    CODE MIRROR FIELD HERE

{% else %}
    {{ forms.textareaField({
        label: 'Template'|t('app'),
        name: 'template',
        value: template,
        rows: 8,
        errors: model.getErrors('template'),
    }) }}
{% endif %}

Couldn't find anything about it.. do you know?

bertoost avatar Feb 09 '19 18:02 bertoost

You can use Code Editor for this: https://github.com/nystudio107/craft-code-editor/

khalwat avatar Nov 04 '22 22:11 khalwat