Giter Site home page Giter Site logo

cole007 / formerly Goto Github PK

View Code? Open in Web Editor NEW

This project forked from enigmadigital/formerly

0.0 2.0 0.0 166 KB

Plugin to allow users to create custom forms within Craft CMS

License: MIT License

PHP 62.53% HTML 34.95% CSS 0.20% JavaScript 2.32%

formerly's Introduction

Formerly 1.4.0

Installing

  1. Copy the formerly directory into your craft/plugins directory
  2. Browse to Settings > Plugins in the Craft CP
  3. Click on the Install button next to Formerly

Setting up forms

Users (both admin and client) can easily create forms in the Formerly admin section, under the Forms tab. A form consists of:

  • A name, used as the title of the form that a visitor to the site may see
  • A handle, used to programatically refer to this form
  • Several emails that will be sent upon the submission of a form by a visitor
  • Several questions which make up the form

Outputting the form

A form can be rendered using, e,g.

{% set form = craft.formerly.form('handle') %}
{% include 'form.html' with { form: form } %}

Where form.html is Twig code that iterates through the form's questions, creating form markup. An example form.html is provided with the source code for this plugin.

You can also obtain a form instance by having a content editor select a form using the Formerly field type, e.g.

{% include 'form.html' with { form: entry.form } %}

Viewing submissions

Form submissions are a Craft Element, which means that you can query them using regular ElementCriteriaModels. For example, to list submissions to the competition form who have selected Australia as their country:

{% set submissions = craft.formerly.submissions
  .form('competition')
  .country('Australia')
  .sort('dateCreated desc') %}
{% for submission in submissions %}
  Name: {{ submission.name }}
  Email: {{ submission.email }}
  {# ... #}
{% endfor %}

Updates

1.4.0

  • Add Customer error and validation pattern to question

  • collapse question details (with the extra fields it was getting out of control)

  • add getQuestionbyHandle method

  • id {id} and {siteUrl} tag replacement to emails. id is replaced by submissionid, siteUrl by craft()->config->get("siteUrl")

  • comma listing bug in submission view

  • Add timezoneoffset setting to adjust mysql dates for charting (eg. add 10 hours for Sydney)

    'formerly' => array(
        'timezoneOffset' => '+10:00', //Australia/Sydney
      ),      
  • 1.3.6

    • Desktop widget
    • parameter option to submissions page - pass sourcekey= in the url and it will default to that form
  • 1.3.5

    • change settings back to use newer syntax
    • Add html markup to default email
    • add sendEmails flag, so you can disable email sending in an environment (eg. dev)
      'formerly' => array(
          'sendEmails' => false
      ),      
    • add writeEmailBodyToFilePath setting, logs emails in json format in the path specified
      'formerly' => array(
        'writeEmailBodyToFilePath' => '/vagrant/emails',
      )
  • 1.3.4

    • Add to and from date filters to export
    • replace \n with
      for multilinetext submissions
    • just show multioption selected value not all available options
    • Fix memory error when exporting large csv, queries in blocks 500 submissions rather than all
  • 1.3.3

    • fix to honeypot code so syntax works in php 5.2
  • 1.3.2

    • support for ajax posting of forms
    • file upload type (add 'assetFolderId' => to your config)
    • remove check for if current form email has already submitted form, this should be the exception rather than rule. You may want users to be able to post multiple times (for example a bug reporting form). If you want this functionality add it yourself using an ajax action:
    • add handle instruction to questions so it is clearer what tag to use in emails
    • Expose instructions so you can enter extra long labels
    • Add value to list items so you can now enter label and value
    • new "customlist" type, similar to "custom" but for lists
    • Don't show checkboxes in the submission list view (they take way too much space)
    • Create RawHTML type for output blocks of html on a form
    • Don't crash if form tags are wrong in the email template, just leave the tags un-replaced
    • bug fix - don't crash if styles are in the email template
    • Simple honeypot checking (add 'honeyPotName' => 'my_cool_name' to general settings, submission code will check for the existance of a post value with that name)
  • 1.3.1

    • Remove limit to 100 export items
    • Fix bug to display multiple options in submission results (alexbrindalsl)
    • Fix multiple form dropdown not remembering which form selected and and - select form option (Silvaire)
    • Fix export multiple options (joshangell)
    • Add "custom" field type (alexbrindalsl's coded field type)
    • fix checkbox bug in sample
  • 1.3.0

  • 1.2.0

    • Add ability to delete submissions.
    • Fix error when viewing submissions.
  • 1.1.2

    • Updated edit form UI to follow new Craft 2.3 Matrix appearance.
  • 1.1.1

    • Fix exception thrown when submitting forms.
  • 1.1.0

    • Add ability to export form submissions as CSV.
  • 1.0.2

    • Fix error when submitting form while not logged into Craft.
  • 1.0.1

    • Fix error preventing questions from saving properly.
  • 1.0.0

    • Initial release!

Todo

  • Better validation
  • More question attributes, e.g. placeholder, error messages

formerly's People

Contributors

devoth avatar noisysocks avatar wiso1234 avatar

Watchers

 avatar  avatar

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.