Error message

Deprecated function: Array and string offset access syntax with curly braces is deprecated in include_once() (line 20 of /home/emun/public_html/includes/file.phar.inc).

Development of a CCK Webform Module

Wed, 12/14/2016 - 11:41 -- admin

While planning for the Fort Bend Women's Center charity event that we sponsored, I was tossing ideas back and forth about how to handle the requests for pickup of donated goods for the thrift store. Webform does a great job of getting you halfway there, but the submissions aren't exposed to views and it doesn't give you access to the full featureset available to CCK.

The mother of invention being necessity, I set to work creating the module that would allow the use of any content type (with certain requirements) to be used as a webform.

Motivation:

 

 

A large number of sites have a need for webforms as part of their workflow and site requirements. While a very capable module exists (webform), it does not use CCK fields and does not expose webform results as nodes for use in views. There are a host of supporting modules for webform that attempt to fill this gap. This is a more direct solution, turning the node creation form for a content type directly into a webform. This will provide you access with the full array of tools and field types available to CCK and will allow you to use the submitted data within your site with less work.

Goal:
The cck_webform module is intended to provide an easy to configure, drop in module to add webform functionality to your site while leveraging your experience with one of the most used modules in all of drupaldom (CCK). This module will also give you the ability to manipulate and provide reports on your submissions using another widely used tool, views.

Functionality:
Displays an additional fieldset on content type edit form for content types with at least one field. This fieldset contains configurational data for the webform, allowing you to set notification address, optional cc field and customize the email subject and body using tokens. When a node of that type is created, the email is sent.

Configurable Options:

  • Use this content type as a webform
  • Notification email address
  • Optional cc email field (select box of fields available on this content type)

Files:
LICENSE.txt
cck_webform.info
cck_webform.install
cck_webform.module

Status:

What's missing is the view for reporting the submissions. I'll be adding that in the next few days along with Simplenews integration. Needs sanitization of user input. Will be added next.

Usage:

 

To use the module, create or use an existing content type with at least one field (text field would be most appropriate - module does not check this atm). When the content type exists, a new section will appear on the content type edit form. This will allow you to configure the webform. After doing so, and specifying that the webform should be used via the exposed checkbox any nodes of that type created will create a notification email to the specified address.

To date, the module is missing some nifty features, and I'll likely devote future posts to their implementation.