{% extends 'formie/_layouts/settings' %} {% import '_includes/forms' as forms %} {% import 'verbb-base/_macros' as macros %} {% set crumbs = [ { label: craft.formie.getPluginName() | t('formie'), url: url('formie') }, { label: 'Settings' | t('app'), url: url('formie/settings') }, { label: 'Stencils' | t('formie'), url: url('formie/settings/stencils') }, ] %} {% set bodyClass = 'fui-body fui-body-start' %} {% set selectedSubnavItem = 'forms' %} {% block main %}
{{ actionInput('formie/stencils/save') }} {{ redirectInput('formie/settings/stencils/edit/{id}') }} {{ csrfInput() }}

{{ 'Create your stencil' | t('formie') }}

{{ 'Before you get started, you’ll need a name for your stencil.' | t('formie') }}

{# Would be great to use v-model, but Craft's fields add `inputAttributes` to the outer div element #} {{ forms.textField({ first: true, label: 'Name' | t('app'), instructions: 'What this stencil will be called in the control panel.' | t('formie'), id: 'title', name: 'title', autofocus: true, required: true, inputAttributes: { ':value': 'name', '@input': 'name = $event.target.value', }, }) }} {{ 'Advanced' | t('app') }}
{{ 'Cancel' | t('formie') }}
{% endblock %} {% js %} document.addEventListener('vite-script-loaded', function(e) { if (e.detail.path === 'src/js/formie-form-new.js') { new Craft.Formie.NewForm({ name: '{{ stencil.name ?? '' }}', handle: '{{ form.handle ?? '' }}', formHandles: {{ stencilHandles | json_encode | raw }}, maxFormHandleLength: {{ maxFormHandleLength | json_encode | raw }}, }); } }); {% endjs %}