GithubHelp home page GithubHelp logo

bolt / boltforms Goto Github PK

View Code? Open in Web Editor NEW
52.0 15.0 56.0 2.35 MB

Bolt 3 Forms extension - Symfony interface and API for Bolt

Home Page: http://bolt.cm

License: GNU General Public License v3.0

PHP 90.33% CSS 0.30% JavaScript 0.87% Twig 8.50%
bolt extension php symfony-forms bolt-forms forms

boltforms's Introduction

⚠️ Note - Not the latest version
This is the repository for Boltforms for Bolt 3. Please know
that Bolt 5 has been released. If you are starting a new
project, please use the following:
- Bolt 5 Forms repository

Bolt Forms

Bolt Forms is an interface to Symfony Forms for Bolt 3. It provides a Twig template function and exposes a simplified API for extending as you need.

Documentation

For full documentation see the Online docs.

boltforms's People

Contributors

aerth avatar bobdenotter avatar clemaj avatar colorando-de avatar craigmillerdev avatar dadaxr avatar diskoflorian avatar emarref avatar errogaht avatar evertalbers avatar ghispi avatar gwendolenlynch avatar ichag avatar jadwigo avatar maelstromeous avatar mikenosko avatar milosa avatar nestordedios avatar nlemoine avatar pakadesign avatar phillippohlandt avatar rixbeck avatar rossriley avatar rudott avatar sahassar avatar sbani avatar slick0 avatar svivian avatar xiaohutai avatar zbrag avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

boltforms's Issues

The fields replyto_name and replyto_email doesn't seem to work

Hi, I am using boltforms in a simple contact form and I let the fieldnames configured as is specified in the default configuration:

    replyto_name: name                    # A field name, specified in the fields: section below
    replyto_email: email                     # A field name, specified in the fields: section below

obviously those field names exists in the fields configuration:

fields:
    name:
      type: text
      options:
        required: true
        label: Nombre
        attr:
          placeholder: Name *
        constraints: [ NotBlank, {Length: {'min': 3}} ]
    email:
      type: email
      options:
        required: true
        label: Email address
        attr:
          placeholder: Email *
        constraints: [ NotBlank, Email ]

then I do the following: write a test email and -> get that email in my inbox -> click the button reply

this doesn't show the values I wrote in the fields of the test email. Am I missing something??

Chained selectors

I'm new to Bolt Forms so I don't know if this is possible.
I want to make to fields: State and City and when I choose one state the field City loads all the cities of that state.
It's possible?
How can I do this?

override form template

Lame questrion
in boltforms.bolt.yml there are definied form templates , they are located in extensions/vendor ...

is there any simple way (without edtiting twig in extensions/vendor) to override this templates (where to put my overrided twigs ? )

Notification message on different place in template

Hi there,
is there any way how to show up the notification messages out of the boltforms_form.twig template?

I would like to use this part:

{% if error and app.request.get(formname) %}
    <p class="boltform-error">{{ error }}</p>
{% endif %}

{% if message and app.request.get(formname) %}
    <p class="boltform-message">{{ message }}</p>
{% endif %}

in my record.twig template on the different place than {{ boltforms('myform' ) }}

Could you please help?
Thank you,
Josef

Problem with uploading an image using BoltForms

Hi,
I have problem with uploading an image, in config i have a field with type: file. It renders nice html input type=file, but when i click submit, i've got exception:
"Cannot use object of type Symfony\Component\HttpFoundation\File\UploadedFile as array"

Is it possible to upload files using this extension? It would be lovely, because I'm trying to add new records of contentype via frontend.

Adding field value into subject

Hi,
is it possible to add field value (drop down for example) into subject?
I'm tried to modify /src/Email.php several times but still no result.

Thanks!

Use default php mail function

Is there a way to use this extension with the default php mail function? I have to setup mailoptions, but my provider says I have to use php's built in mail funcion. When I don't set mailoptions, the extension says I have to... With a test script I verified that the default mail funcion works. When I don't set mailoptions in the config file, the extension does nothing.

A catchable fatal error...

Hi,

I think I got all the config stuff right but I keep getting this message and I don't know what it means:

url: http://stortemelk2.boors.ma/sollicatieformulier

Can anyone make something useful out of this:

Catchable fatal error: Argument 1 passed to Symfony\Component\Form\FormRenderer::searchAndRenderBlock() must be an instance of Symfony\Component\Form\FormView, null given, called in /Volumes/Data/peter/Sites/stortemelk2/vendor/twig/twig/lib/Twig/Environment.php(403) : eval()'d code on line 187 and defined in/Volumes/Data/peter/Sites/stortemelk2/vendor/symfony/form/Symfony/Component/Form/FormRenderer.phpon line 165

binding with contenttype/database

Hello
When i try to bind form with created contenttype it screams about database integrity

It seems that adding to database requires fields like slug,datecreated,datechanged,status

How to add values from form to contenttype(database) without creating those fields in form ?

file/image uploads with save to contenttype don't work but save to table works

If I have a file upload field in a boltform and I save the form to a contenttype the files are uploaded but the image field in the content type will not be populated.

  database:
    contenttype: agenda
  fields:
    image:
      type: file

If I do the same but save the form to a bolt table - that is actually the same as the bolt contenttype - the image fields are populated

  database:
    table: bolt_agenda
  fields:
    image:
      type: file

I want a choice option to invalidate the field is this possible?

I have a reason to make sure users make eleborate choices rather than submitting predefined values, thus I want the first option of selectboxes to be invalid. Any ideas?

<opt>--</opt> <-- false and should invalidate field if picked
<opt>Yes</opt>  <-- true
<opt>No</opt>  <-- true

*edit: any other way than creating an empty key:value pair?

how to get form data in subject template

In boltforms.bolt.yml

  templates:
   form: partials/_contact_form.twig
   email: partials/_contactform_email.twig
   subject: partials/_contactform_email_subject.twig

in subject template file

{% spaceless %}
{{ subject }} from {{ name }} - jdhandbagfactory.com
{% endspaceless %}

but the subject of the email is missing the value "name", how can i get the name value from the form data in subject template?

dynamic to_email config

How can i change this parameter dynamic on presubmit event? ? i want send an email selecting email from choice field.
Regards

Inconsistent class usage

Some classes use the base boltform, others boltforms. See boltforms_form.twig as example. Line 57 uses boltform, line 67 uses boltforms.

This should be consistent throughout the extension. I would make a PR, except that I just started using this extension so I would probably miss a lot.

Recaptcha error notice

I have this custom boltform twig. This is from another issue ( I think @GawainLynch wrote it himself 😄 ). The form shows the error message for the recaptcha without having done anything yet. I don't understand why it is not just on display none until you entered the form. This makes users think there could be something wrong with the site if this error is there by default.

{% form_theme form 'boltforms_custom.twig' %}

{% block boltforms_css %}
<link href="{{ paths.theme }}extensions/boltforms/boltforms.css" rel="stylesheet" type="text/css" />
{% endblock boltforms_css %}

<div class="boltform">
{% if error and app.request.get(formname) %}
    <p class="boltform-error">{{ error }}</p>
{% endif %}

{% if message and app.request.get(formname) %}
    <p class="boltform-message">{{ message }}</p>
{% endif %}

{% if not sent %}

    {{ html_pre }}

    {% if recaptcha.theme|default('clean') %}
    <script>
        var RecaptchaOptions = {
            theme : '{{ recaptcha.theme }}'
        };
    </script>
    {% endif %}

    {{ form_start(form, {'attr': {'name': formname}}) }}
        {{ form_errors(form) }}

        {% for key, value in fields  %}
            {% if value.config.name != 'submit' and value.config.name != 'record_type'  and value.config.name != 'record_id' %}
            <div class="boltforms-row{% if form[key].vars.attr.class is defined %} boltforms-{{ form[key].vars.attr.class }}-row{% endif %}">
                {{ form_label(form[key]) }}
                {{ form_errors(form[key]) }}
                {{ form_widget(form[key]) }}
            </div>
            {% elseif value.config.name == 'record_type' %}
                {{ form_widget(form.record_type, { 'value' : record.contenttype }) }}
            {% elseif value.config.name == 'record_id' %}
                {{ form_widget(form.record_id, { 'value' : record.id }) }}
            {% endif %}
        {% endfor %}

        {% if recaptcha.enabled %}

            {% if not recaptcha.valid %}
            <div class="boltform-error">
                <p class="boltform-errors">{{ recaptcha.error_message }}</p>
            </div>
            {% endif %}

            <div class="boltform-row">
                <label for="form_message" class="required">{{ recaptcha.label }}</label>
                <script src="https://www.google.com/recaptcha/api.js?hl={{ htmllang() }}" async defer></script>
                <div class="g-recaptcha" data-sitekey="{{ recaptcha.public_key }}"></div>
            </div>

        {% endif %}

        <br>

        <div class="boltforms-row{% if form.submit.vars.attr.class is defined %} boltforms-{{ form.submit.vars.attr.class }}-row{% endif %}">
            {{ form_row(form.submit) }}
        </div>

    {{ form_end(form) }}

{% else %}
    {{ html_post }}
{% endif %}
</div>

filtered choice fields

It would be cool to be able to filter the content type results

  fields:
    lookup:
      type: choice
      options:
        choices: 'contenttype::pages::title::slug'
        filters: 
          firstfilter:
            field: some_property
            value: '>12' # some property is larger than 12
          secondfilter:
            field: another_property
            value: 12 # another property is equal to 12

Deprecated message when sending mail

I'm getting

[DEPRECATED]: Previous message logged using deprecated log service: /extensions/vendor/bolt/boltforms/src/Email.php::199

When using the email functionality for a form.

Form sends each message twice

I use version 2.5.1 of BoltForms. When someone uses the contact form or comment form, I get two copies of the same message. Is this some setting I set wrong? Before the update (from 2.1.4) this issue wasn't there.

email keeps including <p> tags

Whenever I send an email I keep getting my stuff wrapped in P tags that are not included within my twig templates. Can you help me figure out where they could be coming from? I already cleared my cache several times aswell


mails as recieved in my gmail using developermode:

Multiple emails

Hi,
Is it possible to use multiple email adresses for the to_email, cc_email and bcc_email fields ?
I tried with an yml array like this
cc_email: ['[email protected]', '[email protected]']
But that doesn't seam to work (and it does with a single value).

Database Insertion issue

When inserting from a multi-choice field to a database, the string 'Array' is set, instead of an value actually signifying the options.
Field:

mods:
      type: choice
      options:
        required: true
        label: What do you want to subscribe to?
        choices: [ Origin, Compression ]
        multiple: true

Database column is named 'mods', type: varchar(256), utf8_general_ci

Add possibility to parse from content

I wanted to add the possibility to add {{ form... }} in any field content of the fields. So you can add the form within a text field. Like you can add int in the tpl.

What do you think? Is it possible with no hassle?

Form constraint errors not being translated

So. I have a form with constraints.
A not blank constraint gets the error 'This value should not be blank' instead of a translated one.
Silex apparently has the german translations for this.
When I set the locale: 'de' instead of 'de_DE' in the bolt config, the value is translated, but the bolt backend isn't translated anymore. :(

I'm not sure how to fix this properly. Maybe you can change the fallback locale to the first part of the whole locale.

Send notification not implemendted...

We talked earlies about this extension. It works just fine... except for the send notification. This was fixed in 12a4f03 but not implemented yet.

I just installed the extension for an other website and the send notification worked after I uploaded the newer file myself.

Change value / text of submit button

Hi,

Perhaps it is painstakingly obvious but I cannot find anywhere in the documentation where it states how to change the button text from the standard text submit.

In the extension simpleforms it's button_text: Send it!
But I don't want to use 2 form extensions just because I can't find how boltforms does this 😊

Boltforms returns success even if mail isn't delivered to smtp server

To reproduce:

Configure bolt to use a local smtp server
Turn off smtp service
Fill out form and submit

Boltforms will happily return a 'message is successfully sent' message, even though below that, bolt itself will return swiftmailer errors. These, however, will be below the fold for many users, leaving them to think their form was submitted successfully.

Screenshots included. Success Message in Dutch, but you'll get the picture ;)

screen shot 2015-12-25 at 17 34 18

screen shot 2015-12-25 at 17 34 39

multiple file upload

Thanks for the nice extension. It would be useful if multiple file uploads would be handled.
If I do this:

documents:
  type: file
  options:
  required: false
  label: Documents
  attr:
    multiple: true

I can upload multiple files as the attribute gets added to the input element, but the extension only handles one (the last one selected?)

Dynamic email notif configuration

Hello, I have played with Bolt Forms a few days and I think I'm stuck.

How can I add/edit the email notification dynamically? Maybe via a local extension?

Example: Based in a selected choice in the form, I need to change the main email recipient or add a cc email.

I tryed to use PRE_SUBMIT event and add a cc_name/cc_email to the notification configuration related to the form but nothing happens. Is there another way to do this?

Error when updating in Bolt back-end

Not a very clear bugreport probably, I cannot see the error notification well in the Bolt back-end, but I get this error when I hit the update extension-button:

Whoops \ Exception \ ErrorException (E_ERROR)

Call to undefined method Composer\DependencyResolver\Operation\UpdateOperation::getPackage()


/domains/streeff.nl/test/extensions/installer.php

namespace Bolt\Composer;

class ExtensionInstaller
{
    public static function handle($event)
    {
        try {
            $installedPackage = $event->getOperation()->getPackage();
        } catch (\Exception $e) {
            return;

and in the left column I also see

0.
…/­extensions/­installer.php9

somewhere.

I have used it in a test-site, so for now I'll just go back to that other Bolt-form extension.

Redirect on formsubmit

This is my form in the .yml file.


# Commentsform
comments:
  feedback:
    redirect:
      target: http://www.make-itjustforyou.nl/reviews
  templates:
    form: boltforms_form_comments.twig
  database:
    contenttype: comments
  fields:
    record_type:
      type: hidden
    record_id:
      type: hidden
    title:
      type: text
      options:
        required: true
        label: Uw naam
    comment:
      type: textarea
      options:
        required: true
        label: Schrijf een review
        attr:
          placeholder: Your message...
          class: cf-comment
    submit:
      type: submit

I have also tried /page/reviews and page/reviews and reviews as target. But the form wil not redirect.

I build a comment form off another post. Which is working fine btw, the only thing I can't figure out is why on submit the form wont redirect to the same page. I want to do this because I don't want users to F5 and resubmit there comment again. If there is any other way to prevent this I would like to be pointed in to the right direction. I'm really starting to get the hang of Bolt, So i'm not looking for a copy paste sollution unless its stupid easy facepalming obvious, and I just overlooked something
bolt/bolt#3472

ajax return messages

are you planning to add ajax functionality e.d. to display return messages for like errors and success?

date field content can't be emailed

See bolt/bolt#3459

If you have a date field in your form the emailer will not handle it correctly and exit with an error

Catchable fatal error: Object of class DateTime could not be converted to string in /[..]/vendor/twig/twig/lib/Twig/Environment.php(332) : eval()'d code on line 78

It can be fixed by adding a small loop to https://github.com/GawainLynch/bolt-extension-boltforms/blob/master/src/Email.php#L96

        foreach($formdata as $key => $value) {
            if ($value instanceof \DateTime) {
                $formdata[$key] = $value->format('c');
            }
        }

example submits indexes for choices and not values (config.yml)

Current example: [value1, value2]
Desired example:{key1: 'value1', key2: 'value2'}

Only in the last example this notation is used. Maybe it was intended for me to figure out on my own, but I can't read minds.

In my case the array notation causes only indexes to be submitted. I am not sure if this is a local issue or a general occurance.

Two g-recaptcha in one page

Hello!
I have 2 boltforms with recaptcha. Im moved JS code for recaptcha to main js file, all works, but not PHP. When im submit one form - all forms grecaptcha fields are marked as incorrect. And im cant understand how BoltFormsExtension::twigBoltForms() make TWO calls of reCaptchaResponse()
im submit only one form! im think problem is like reCaptchaResponse() send to google validation token from other form, from page, not form which i currently submit

File upload aborted as the target directory could not be created.

My boltforms.bolt.yml

templates:
  form: boltforms_form.twig
  email: boltforms_email.twig
  subject: boltforms_email_subject.twig
  files: boltforms_file_browser.twig

recaptcha:
  enabled: false
  label: "Please enter the reCaptcha text to prove you're a human"
  public_key: ''
  private_key: ''
  error_message: "The CAPTCHA wasn't entered correctly. Please try again."
  theme: clean

csrf: true

uploads:
  enabled: true                                  # The global on/off switch for upload handling
  base_directory: /files/attachment/             # Outside web root and writable by the web server's user
  filename_handling: prefix                      # Can be either "prefix", "suffix", or "keep"
  management_controller: true                   # Enable a controller to handle browsing and downloading of uploaded files

debug:
  enabled: false
  address: [email protected]

contact:
  notification:
    enabled: true
    debug: false
    subject: new inquiry
    from_name: notifier               # A field name, specified in the fields: section below
    from_email: [email protected]             # A field name, specified in the fields: section below
    replyto_name: name            # A field name, specified in the fields: section below
    replyto_email: email          # A field name, specified in the fields: section below
    to_name: aa     # Must be valid text
    to_email: [email protected] # Must be valid email address
    cc_name: someone
    cc_email: [email protected]
    attach_files: true
  templates:
   form: partials/_contact_form.twig
   email: partials/_contactform_email.twig
   subject: partials/_contactform_email_subject.twig
  feedback:
    success: Message submission sucessful
    error: There are errors in the form, please fix before trying to resubmit
  fields:
    name:
      type: text
      options:
        required: true
        label: Name
        attr:
          placeholder: Your name...
        constraints: [ NotBlank, {Length: {'min': 3}} ]
    email:
      type: email
      options:
        required: true
        label: Email address
        attr:
          placeholder: Your email...
        constraints: [ NotBlank, Email ]
    message:
      type: textarea
      options:
        required: true
        label: Your message
        attr:
          placeholder: Your message...
          class: myclass
    upload:
      type: file
      options:
        required: false
        label: Attachment
    remote_ip:
      type: hidden
      options:
        label: false
      event:
        name: server_value
        params:
          key: REMOTE_ADDR
    submit:
      type: submit

and `partials/_contact_form.twig

{% form_theme form 'boltforms_custom.twig' %}

{% block boltforms_css %}
<link href="{{ app.paths.extensions }}vendor/bolt/boltforms/css/boltforms.css" rel="stylesheet" type="text/css" />
{% endblock boltforms_css %}

{% if debug %}
<p class="boltform-error">[Debug] Notification debug mode enabled!</p>
{% endif %}

{% if error and app.request.get(formname) %}
<p class="boltform-error">{{ error }}</p>
{% endif %}

{% if message and app.request.get(formname) %}
<p class="boltform-message">{{ message }}</p>
{% endif %}

{% if not sent %}
  {{ html_pre }}
  {% if recaptcha.enabled and recaptcha.theme|default('clean') %}
  <script>
  var RecaptchaOptions = {
    theme : '{{ recaptcha.theme }}'
  };
  </script>
  {% endif %}

  {{ form_start(form, {'attr': {'name': formname, 'class': 'pure-form pure-form-aligned contact-form'}}) }}
    {{ form_errors(form) }}
    <fieldset>
      <span>We’d love to hear from you and answer any questions you may have.</span>
      {% for key, value in fields  %}
      {% if value.config.name != 'submit' %}
      <div class="pure-control-group {% if form[key].vars.attr.class is defined %} boltforms-{{ form[key].vars.attr.class }}-row{% endif %}">
        {{ form_label(form[key]) }}
        {{ form_errors(form[key]) }}
        {{ form_widget(form[key]) }}
      </div>
      {% endif %}
      {% endfor %}

      {% if recaptcha.enabled %}

      {% if not recaptcha.valid %}
      <ul class="boltform-error">
        <li class="boltform-errors">{{ recaptcha.error_message }}</li>
      </ul>
      {% endif %}

      <div class="boltform-row">
        <label for="form_message" class="required">{{ recaptcha.label|trans({}, translation_domain) }}</label>
        <script src="https://www.google.com/recaptcha/api.js?hl={{ htmllang() }}" async defer></script>
        <div class="g-recaptcha" data-sitekey="{{ recaptcha.public_key }}"></div>
      </div>

      {% endif %}

      <div class="pure-controls {% if form.submit.vars.attr.class is defined %} boltforms-{{ form.submit.vars.attr.class }}-row{% endif %}">
        {{ form_widget(form.submit, {'attr': {'class': 'pure-button pure-button-primary'}}) }}
      </div>
    </fieldset>
  {{ form_end(form) }}
{% else %}
  {{ html_post }}
{% endif %}

and the folder is

vagrant@vagrant-ubuntu-trusty-64:~/www/jdhandbagfactory.com/public/files$ ll
total 968
drwxrwxrwx 5 vagrant  www-data   4096 Dec 28 03:54 ./
drwxrwxrwx 8 vagrant  www-data   4096 Dec 16 03:28 ../
drwxrwxrwx 2 vagrant  www-data   4096 Dec 17 06:12 2015-12/
-rwxrwxrwx 1 vagrant  www-data  67817 Nov 29  2014 agriculture-cereals-field-621.jpg*
-rwxrwxrwx 1 vagrant  www-data  34374 Nov 29  2014 alarm-clock-gold-hands-of-a-clock-1778.jpg*
-rwxrwxrwx 1 vagrant  www-data  51381 Nov 29  2014 analog-camera-photography-vintage-1844.jpg*
-rwxrwxrwx 1 vagrant  www-data  50441 Nov 29  2014 apple-desk-iphone-2750.jpg*
-rwxrwxrwx 1 vagrant  www-data  75559 Nov 29  2014 architecture-books-building-2757.jpg*
drwxrwxrwx 2 www-data www-data   4096 Dec 28 09:43 attachment/
-rwxrwxrwx 1 vagrant  www-data  47377 Nov 29  2014 bell-bills-cash-register-2738.jpg*
-rwxrwxrwx 1 vagrant  www-data  53149 Nov 29  2014 blur-breakfast-coffee-271.jpg*
-rwxrwxrwx 1 vagrant  www-data  45555 Nov 29  2014 blur-flowers-home-1093.jpg*
drwxrwxrwx 2 vagrant  www-data   4096 Nov 13 09:24 brands/
-rwxrwxrwx 1 vagrant  www-data  98747 Nov 29  2014 building-frame-garage-1599.jpg*
-rwxrwxrwx 1 vagrant  www-data  46019 Nov 29  2014 california-foggy-golden-gate-bridge-2771.jpg*
-rwxrwxrwx 1 vagrant  www-data  56656 Nov 29  2014 carrot-cooking-eat-1398.jpg*
-rwxrwxrwx 1 vagrant  www-data  39299 Nov 29  2014 configure-disc-jockey-disco-1504.jpg*
-rwxrwxrwx 1 vagrant  www-data  94855 Nov 29  2014 food-fruit-orange-1286.jpg*
-rwxrwxrwx 1 vagrant  www-data 102211 Nov 29  2014 garden-gardening-grass-589.jpg*
-rwxrwxrwx 1 vagrant  www-data    191 Jul 24  2014 .htaccess*
-rwxrwxrwx 1 vagrant  www-data      4 Jul 24  2014 index.html*
-rwxrwxrwx 1 vagrant  www-data  65909 Nov 29  2014 keyboard-old-technology-2318.jpg*

I can receive email when I delete the upload field in the form contact, so could somebody help me with is problem? so many thanks!

after first submitting a form, a page refresh resubmits the form

If you have a boltform on a page that has no redirect and you submit a form.
If you then refresh that page, the browser usually asks if you want to resubmit the form - say yes (the default action for every popup form that normal users do), and you have resubmitted the form.

This leads to double emails, double posts, and lots of noise in your email and/or database.

The form sould either prevent double submissions by checking if it's the same as a previous submission (hard)
or by redirecting to the result page after submission (easier)

3 questions

For my forms (3 in total) I have a set of requirements. It speaks for itself that I intend to built them myself, but I really need to know where to go from here.

  1. I need at least 1 checkbox to agree with terms of service.
  2. I need 1 of my forms to be valid when 4 specific fields are empty. These are optional if they do not apply to the user. If the user decides to enter a single value, they should all be valid.
  3. I need to alter the attributes of elements for my form to display properly. Where do I do this?

So far I know that I should make an extension to make this happen. I've been given this on validation. I've read this. yet I still don't think I'm getting anywhere.

Question: fieldsets?

I can't find any information about fieldsets (or postfixes, prefixes) in BoltForms. I also checked the Symfony docs.
Is there a way to add that kind of stuff in the 'fields' section in the config file?

ordered choice fields

It would be cool to be able sort the content type results on some field

  fields:
    lookup:
      type: choice
      options:
        choices: 'contenttype::pages::title::slug'
        sort: 'contenttype::pages::-id'

or something like

  fields:
    lookup:
      type: choice
      options:
        choices: 'contenttype::pages::title::slug'
        sort: -publishdate

Conditional field to predict outcome when user is filling a form

Hi,

I'm looking for a way to build a form that has conditional fields, depending from the settings of this form it can have a different outcome on submit. I don't know how advanced it can get with bolt forms but I want te make a little form where visitors can fill in a list of questions (radios) and the outcome will be which person could best help them with there questions. Is this possible? It should have to work with radio buttons only.

example 1

radio button1 equals a
radio button2 equals c
radio button3 equals e

submit

outcome

person A

example 2

radio button1 equals e
radio button2 equals b
radio button3 equals b

submit

outcome

person C

I hope i have been clear enough for you to understand what I want. It's not a regular form that gets send to an emailadres. But rather it post the outcome of the form.

Mailoptions documentation

Is there any documentation about the mailoption settings?

mailoptions:
    transport: smtp
    spool: true
    host:
    username: 
    password: 
    port: 25
    encryption: null
    auth_mode: null
    senderMail: null
    senderName: null

I'm still trying to get BoltForms to work ... What are the options for auth_mode for instance?

[Feature request] Ability to send a download link instead of attaching files

Hey,

I took this up on IRC, but thought I'd mention it here too.

I'd love to be able to send a download link to a file instead of attaching it to the email, which would cover scenarios like when attachments have a greater risk of getting caught in spam filter and when files are too large for attachments.

Typo & </ul> in boltforms_email.twig

fields - Field data fron the form configuration < n = m

and there's a /ul in the loop that doesn't belong there (I think)

{#
 # Passed in variables:
 #   fields     - Field data fron the form configuration
 #   config     - Email configuration date
 #   data       - The posted data
 #}
{% import "boltforms_macros.twig" as macros %}
<p>Hi,</p>

<p>Somebody used the form on {{ paths.currenturl }} to send you a message. The posted data is as follows:</p>
<hr>
{% for label, value in data -%}
    {%- set field = fields[label] -%}
    {%- if field.options.label|default('') is empty -%}
{{ macros.label_value(label, value) }}
    {%- else -%}
        {%- if value is iterable -%}
<p>{{ macros.label(label) -}}
        {%- for val in value -%}
{{ macros.value(val) }}
            {%- endfor -%}
</ul></p>
        {%- else %}
{{ macros.label_value(label, value) }}
        {%- endif -%}
    {%- endif -%}
{%- endfor -%}

<hr>
<em>Sent by the <a href="https://github.com/GawainLynch/bolt-extension-boltforms">BoltForms</a> extension for <a href="https://bolt.cm">Bolt</a>.</em>

Error when I try to use reCAPTCHa (2.5.1)

When I set reCAPTCHa te 'true', the form gives me an error (see screenshot). Am I doing something wrong? And is there something I have to ad to the template to display the reCAPTCHa part?
screenshot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.