Configuring Webform for our website

Now that we have Webform installed and enabled, let's take a look at some of the global configuration settings that will apply as defaults on every piece of Webform content that you create on this site.

Webform provides a highly flexible and configurable content type. Certain options have been identified as being generally constant for all Webforms on a particular site and these have been isolated on the Webform settings page.

How to do it...

The global Configuration settings for Webform can be reached either by clicking the Configure link next to Webform on the Modules page, or by clicking on Webform settings under Content Authoring on the Configuration page (click Configuration in your administrative menu bar).

How it works...

The options and settings we select here will apply as default values on every new Webform piece of content we create. Many of these may be overridden in the configuration settings of specific forms if required.

There's more...

Understanding the configuration options will give us a good overview of Webform in broad strokes. As we progress through the book with the demonstration Webform we will discover the finer nuances in greater detail. We will not be changing any of these default settings at this point, but we will briefly discuss what they mean in order to get an idea of the scope of Webform. As what follows is intended as an introductory overview, the next few paragraphs will be easier to follow while referencing the Webform settings page.

Webform-enabled content types

To promote flexibility, the components of Webform may be associated with various types of content. A basic Drupal installation comes with two basic content types, Basic Page and Article. With this setting we can extend the existing content type by making Webform available within it. This permits us even to create a custom Drupal content type while leveraging the power of Webform.

Webform components

The purpose of Webform is to facilitate the creation of information-gathering web pages and to provide meaningful back-end support for administrators who need to work with that data. Over the years, Webform has developed a set of components which blend with ease of use for the end user, as well as provides both convenience and control for website administrators.

The components are so named because they are, in reality, more than just data fields. A component encapsulates the visual aspects of the field as it will be shown on the form and other output media, default validations to apply to the specific field type, specialized handling and formatting of submitted data for inclusion in spreadsheets for download, and so on.

Each component type represents a different kind of data. The validation of a date, for example, is naturally quite different from rules that would apply to an e-mail address. While many characteristics and settings are common to all components (such as field label for example), each component has their own specific settings and requirements for further handling.

Aside from unique validation requirements, some components also have specialized methods of rendering (that is, how they will look, or be drawn) on a web page. The date and time components, for example, are automatically rendered as appropriate drop-down lists, whereas the file component comes with a browse button.

Tip

Any components that are unchecked on this page will not be available to you when you start building forms.

Default e-mail values

Each Webform can be configured to send one (or more) e-mails when a submission is received. It is customary to send a confirmation of a submission to the end user via e-mail, but you can also have Webform additionally send e-mails to one or more administrators. Specifying default values for the automatically generated e-mails here will save you the labor of typing these out on each and every Webform you create on the site:

Default e-mail values

Advanced options

There are forms you want to be filled out by any visitor to the page and other forms you would prefer to have only filled out by users registered on your site. Some forms may be filled out multiple times by the same person, others may only be filled out once. Webform provides some methods of handling access to forms and controlling the number of submissions from a particular source:

Advanced options

A frequent complaint on the Webform issue queue (http://drupal.org/project/issues/webform) is that "Webform is not sending out e-mails!" Quite often, the challenge lies with the operating system of the hosting server. Some Microsoft-based (IIS) servers cannot handle long-format e-mail address headers. If your site is hosted on such a server and you experience difficulties with e-mail, you will need to come to this page and try specifying a different e-mail address format. See http://phptutorial.info/?mail under the Notes heading for a description of the problem.

Part of the awesome functionality that Webform makes available is the facility to download all (or just some of) the data submitted on a form in pseudo-spreadsheet format, such as CSV (Comma Separated Values) or tab separated values files. You may set defaults here that will save yourself and other administrators the bother of specifying them on every occasion that data needs to be downloaded.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset