rossriley / bolt-extension-formeditor

A UI for the Bolt Forms Extension
6 stars 7 forks source link

Config-Parameters get lost #11

Open xstable opened 8 years ago

xstable commented 8 years ago

If you have two Forms (simpleform, servicecontact).

You wan't to use different templates for it, so you defined this in bolftform.yaml:

templates:
    form: /partials/short_contact_form.twig
    email: /partials/short_contact_email.twig
    subject: /partials/short_contact_email_subject.twig
    files: /partials/boltforms_file_browser.twig
recaptcha:
    enabled: false
    label: 'Spam-Schutz: Bitte geben Sie den reCaptcha Text ein.'
    public_key: ''
    private_key: ''
    error_message: 'Der reCaptcha-Text wurde nicht korrekt eingegeben. Bitte versuchen Sie es erneut.'
    theme: clean
csrf: true
uploads:
    enabled: false
    base_directory: /full/path/for/uploaded/files/
    filename_handling: suffix
    management_controller: false
debug:
    enabled: false
    address: bolt_test@bolt.de
contact:
    notification:
        enabled: true
        debug: false
        subject: 'Nachricht von der Webseite'
        from_name: pw-druckerservice.de
        from_email: info@bolt.de
        replyto_name: name
        replyto_email: email
        attach_files: false
        to_name: 'Me Myself'
        to_email: info@myaddress.de
    feedback:
        success: 'Ihre Nachricht wurde erfolgreich gesendet.'
        error: 'Es wurden Fehler im Eingabeformular entdeckt. Bitte überprüfen Sie Ihre Eingaben.'
    fields:
        name:
            type: text
            options:
                required: true
                label: Name
                attr:
                    placeholder: 'Ihr Name…'
                constraints:
                    - NotBlank
                    -
                        Length:
                            min: 3
        email:
            type: email
            options:
                required: true
                label: Email
                attr:
                    placeholder: 'Ihre Emailadresse…'
                constraints:
                    - NotBlank
                    - Email
        message:
            type: textarea
            options:
                required: true
                label: 'Ihre Nachricht…'
                attr:
                    placeholder: 'Ihre Nachricht…'
                    class: myclass
        needreply:
            type: choice
            options:
                label: 'Wünschen Sie einen Rückruf?'
                choices:
                    - Ja
                    - Nein
                multiple: false
                attr:
                    placeholder: ''
                expanded: true
        phone_no:
            type: textarea
            options:
                label: 'Rückrufnummer und Zeitpunkt '
                attr:
                    placeholder: 'Bitte tragen Sie hier Ihre Telefonnummer und einen Zeitpunkt für den Rückruf ein.'
        submit:
            type: submit
            options:
                label: 'Anfrage senden'
                attr:
                    placeholder: ''
                    class: special

templates:
    form: /partials/service_contact_form.twig
    email: /partials/service_contact_email.twig
    subject: /partials/service_contact_email_subject.twig
    files: /partials/service_file_browser.twig

servicecontact:
   fields:

   .... and so on... here comes the form-fields....

If you now edit the "servicecontact" with Edit Forms, the templates:-Section in front of servicecontact will be gone. Only the one at the very beginning of this file is untouched.

SvanteRichter commented 8 years ago

In yaml you can't duplicate the same key with the same context. if you want to use different templates for different forms you do that like this: https://github.com/bolt/boltforms/blob/bolt-2/config.yml.dist#L153-L156