xodigital/formerly 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

xodigital/formerly

Composer 安装命令:

composer require xodigital/formerly

包简介

Craft Plugin that allows users to build their own forms and view form submissions

README 文档

README

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('competition')
  .country('Australia')
  .sort('dateCreated desc') %}
{% for submission in submissions %}
  Name: {{ submission.formhandle_name }}
  Email: {{ submission.formhandle_email }}
  {# ... #}
{% endfor %}

Subscribe to Mailchimp Lists

This function allows for subscribers to be directly subscribed to your mailchimp list.

  1. When adding a form, switch ON the Mailchimp toggle.
  2. Enter your Mailchimp username - used to sign in to mailchimp
  3. Enter your Mailchimp API key
  4. Enter your Mailchimp List Id
  5. For each question, if you have a Custom Merge Tag set in Mailchimp, you must add it under Mailchimp Merge Tag

Each submission will then be added to the list in Mailchimp

Todo

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

统计信息

  • 总下载量: 2.14k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 58
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 58
  • Watchers: 6
  • Forks: 23
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-09-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固