CCK Input Elements

maulwuff - May 24, 2009 - 21:04
Example of CCK Inputs Elements in action

Overview

This is a set of modules, which provide input elements for endusers with the power of cck.
Hu?
Yes. This module hosts a set of fields to be used by the Content Construction Kit. Usually fields are used to create various content types. They appear as input fields when creating or editing a node. They are rendered to text, when visited by endusers.
Here comes the difference: This module can build a webform using CCK.
It is not meant to be a competitor to the webform module, as CCK Input Elements do not provide any means to evaluate or store the data which users send back to your site, when hitting "submit".

Parts

So far the following input elements are available

Fields

  • CCK Input Elements - Checkbox
  • CCK Input Elements - Textfield
  • CCK Input Elements - Hidden Field

Groups

  • CCK Input Elements - Form Group

Dependencies

cck

How to use

CCK input elements are fields for the content construction kit (CCK) module.

Enable the modules you need in your modules list. Every module mentioned in the parts section, is represented by one module.
To build the form shown in the screenshot, enable Checkbox and Form Group.

Go to your content types section and add a new content type, or edit an existing one.
To add a form to your content type, add a new group of type "Fieldgroup as form". Configure the group afterwards. Leave the target url blank, as there is no applicable target available for now.
To add a checkbox to your content type, add a new field of type "Checkbox Input". Configure the amount of checkboxes you need.
Make sure, the checkbox field is a child of the formgroup. Otherwise the checkboxes do not belong to the form and are therefore not submitted.

Now create a new node and configure the checkoxes.

If you submit and view the node, it looks similar to the screenshot above.

As mentioned earlier, there is no logic to evaluate or process the data submitted by this form. This has to be done by other modules.

Processing data

In order to get submitted data back into Drupal, another module is needed which implements data handling.
Developers can have a look at the reservation module for an example.
The D6 reservation module depends on cck inputs and shows how to prepare and process user data. At this point, you need to look at the code in CVS.

Releases

Official releasesDateSizeLinksStatus
6.x-1.0-beta12009-Jul-2811.37 KBRecommended for 6.xThis is currently the recommended release for 6.x.
Development snapshotsDateSizeLinksStatus
6.x-1.x-dev2009-Oct-2612.41 KBDevelopment snapshotDevelopment snapshots are automatically regenerated and their contents can frequently change, so they are not recommended for production use.


 
 

Drupal is a registered trademark of Dries Buytaert.