2017 © Pedro Peláez
 

craft-plugin amforms

Forms plugin for Craft

image

am-impact/amforms

Forms plugin for Craft

  • Wednesday, June 13, 2018
  • by hubertprein
  • Repository
  • 13 Watchers
  • 126 Stars
  • 2,457 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 20 Forks
  • 67 Open issues
  • 33 Versions
  • 1 % Grown

The README.md

amforms

Forms in Craft, made easy, (*1)

CP functionality

When users have permission to access the plugin, they can do various stuff in the CP. There's an extra setting that'll allow users to control the plugin's settings., (*2)

Forms

You're able to activate submissions and / or notifications. This means you could choose to ignore the submissions if you want to, but only receive notifications when a form was submitted., (*3)

NewForm, (*4)

Notifications are activated, and all information will be filled out by default. The Sender name and email addresses fields will automatically contain the information from your email settings in Craft's CP., (*5)

Notifications, (*6)

The plugin will use it's own templates to display forms and email submissions. You have the option to override these templates in general or per form! Just create your own folder in the templates folder (e.g.: _amforms) and create a template that you would like to override. You can see the default template names in the placeholders, so if you create your own template with the same name, you could choose to make this your default templates for all your forms. When you create a template with a different name, you could create a template per form., (*7)

This tab is only available to admins., (*8)

Templates, (*9)

Fields

When you install the plugin, you get some commonly used fields by default. The fields that are created are stored in a different context / scope than Craft's fields. This means that you're able to reuse these fields in any form and that they won't be shown in Craft's field list., (*10)

Fields, (*11)

Export

You have the option to export your submissions per form. You'll be able to choose which fields you'd like to be included in your export (Matrix supported!). When you create an export, it'll start a task that export your submissions into a file located in your storage folder. When it's done, you're able to download the file or restart the export., (*12)

NewExport, (*13)

ExportCriteria, (*14)

ExportOverview, (*15)

Settings

By default, the anti-spam is activated for your forms, but there's also an option to activate Google reCAPTCHA., (*16)

General, (*17)

Exports, (*18)

AntiSpam, (*19)

reCAPTCHA, (*20)

Display your forms

Simple tag

This will only display basic fields!, (*21)

{{ craft.amForms.displayForm('formHandle') }}

Simple field tag

{% set form = craft.amForms.getForm('formHandle') %}

{{ form.displayField('fieldHandle') }}

Simple field tag (using a namespace)

{% set form = craft.amForms.getForm('formHandle') %}
<input type="hidden" name="namespace" value="{{ form.getNamespace() }}">

{{ form.displayField('fieldHandle') }}

Custom HTML



{{ getCsrfInput() }} {# This should always be here! #} {# Insert your form's handle. #} {# Optional: Redirect URL. Will redirect to current page by default. #} {# Optional: Anti-spam protection. #} {{ craft.amForms.displayAntispam() }} {# Optional: Google reCAPTCHA protection. #} {{ craft.amForms.displayRecaptcha() }} {# Place the HTML of your fields here #}

Custom HTML with displayField

{% set form = craft.amForms.getForm('formHandle') %}



{{ getCsrfInput() }} {# This should always be here! #} {# Insert your form's handle. #} {# This will namespace your inputs (for IDs and such), but it's not required though #} {# Optional: Anti-spam protection. #} {{ craft.amForms.displayAntispam() }} {# Optional: Google reCAPTCHA protection. #} {{ craft.amForms.displayRecaptcha() }} {# Place the HTML of your fields here #} {{ form.displayField('fieldHandle') }} {{ form.displayField('aFieldHandle') }} {{ form.displayField('anotherFieldHandle') }}

Custom field HTML

Change formHandle to your form's handle., (*22)

<div class="field">
    <label for="frm_comment">Comment</label>
    <input type="text" id="frm_comment" name="fields[comment]" value="{% if formHandle.comment is defined %}{{ formHandle.comment }}{% endif %}">
    {% if formHandle is defined %}
        {{ errorList(formHandle.getErrors('comment')) }}
    {% endif %}
</div>

Custom Matrix field



{# Notify Craft which Matrix block (handle) will be inserted. Our field name for this example is: Persons Our block name for this example is: Person #} {# Block fields #} {% if formHandle is defined %} {{ errorList(formHandle.getErrors('persons')) }} {% endif %}

Errorlist macro

{% macro errorList(errors) %}
    {% if errors %}
        <ul class="errors">
            {% for error in errors %}
                <li>{{ error }}</li>
            {% endfor %}
        </ul>
    {% endif %}
{% endmacro %}

If you want to include it on the template itself, use:, (*23)

{% from _self import errorList %}

Dashboard widget

Display your recent submissions on your dashboard., (*24)

WidgetSettings, (*25)

WidgetSmall, (*26)

WidgetBig, (*27)

The Versions

13/06 2018

dev-master

9999999-dev

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

29/03 2018

dev-Empty-date-fix

dev-Empty-date-fix

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

27/02 2018

1.8.0

1.8.0.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

02/11 2017

dev-craft3

dev-craft3

Form manager in Craft.

  Sources   Download

MIT

The Requires

 

plugin cms forms craftcms craft

12/06 2017

dev-dev

dev-dev

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

12/06 2017

1.7.0

1.7.0.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

21/10 2016

1.6.1

1.6.1.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

19/10 2016

1.6.0

1.6.0.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

30/09 2016

1.4.5

1.4.5.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

24/08 2016

1.4.4

1.4.4.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

13/07 2016

1.4.3

1.4.3.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

04/05 2016

1.4.2

1.4.2.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

26/04 2016

1.4.1

1.4.1.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

25/04 2016

1.4.0

1.4.0.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

21/04 2016

1.3.8

1.3.8.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

18/04 2016

1.3.7

1.3.7.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

04/04 2016

1.3.6

1.3.6.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

10/02 2016

1.3.5

1.3.5.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

12/01 2016

1.3.4

1.3.4.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

12/01 2016

1.3.3

1.3.3.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

08/01 2016

1.3.2

1.3.2.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

06/01 2016

1.3.1

1.3.1.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

22/12 2015

1.3.0

1.3.0.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

03/12 2015

1.2.10

1.2.10.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

01/12 2015

1.2.9

1.2.9.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

02/11 2015

1.2.8

1.2.8.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

23/10 2015

1.2.7

1.2.7.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

19/10 2015

1.2.6

1.2.6.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

16/10 2015

1.2.5

1.2.5.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

14/10 2015

1.2.0

1.2.0.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

29/09 2015

1.1.0

1.1.0.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

24/09 2015

1.0.7

1.0.7.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein

20/07 2015

1.0.0

1.0.0.0

Forms plugin for Craft

  Sources   Download

The Requires

 

by Hubert Prein