Creating a Webform node

Let's forge ahead now and create a piece of Webform content to define our speaker registration form.

Getting ready

We need to be logged into our site as an administrator with Webform: Create new content permissions to continue. For the purposes of this demonstration it is best if you are logged in as the main site administrator to avoid difficulties with permission issues, as we were when we installed and enabled Webform.

How to do it...

  1. Click on Content in the administrative menu bar at the top of the screen, then click on the Add content link.
  2. The various types of content available on your site are now listed on the page. We want to select the Webform content type.
  3. Let's give our form a meaningful name and enter the text Speaker Registration in the Title textbox.
  4. The Body text area immediately below Title gives us the opportunity to provide an explanatory note about the purpose of the form, so let's enter the following text:

    Speakers at the Fictitious Conference are requested to fill out the form below to ensure an enjoyable conference experience.

    How to do it...
  5. Check the box next to Menu settings, so that our form is accessible from standard site navigation. The default settings that appear are fine as they are.
  6. Now let's click on Comment settings and select the Closed radio button to disable comments for our form.
  7. When we click on the Save button we will be redirected to our new Webform's edit page and we're ready to build our form in earnest.

How it works...

Having created a Webform node (content type), we now have a standard Drupal container for our Webform content. All of the activities that follow in this demonstration will be applied within this node. Drupal automatically assigns a number, called a node ID, to each new piece of content. This number is used within the underlying database to link various database tables and their rows of data.

When we installed and enabled the Webform module in Chapter 1, Setting up Webform, the installation process created several new tables in our database to store information about Webforms. These tables provide storage areas for information regarding different aspects of each Webform we create on our site. The information we entered previously has been written to the Drupal system node table and to the main Webform table.

As we progress through the various phases of building our form, adding form components, configuring response e-mails, and making test submissions, we will be populating additional Webform system tables in the database. The node ID helps the system identify which specific Webform node each bit of data belongs to.

There's more...

If at a later point in time we decide that we would like to enable site visitor comments for our Webform or change the menu settings, we can return to the node settings page by clicking on the EDIT tab. To view what our form currently looks like we may click on the VIEW tab, as shown in the following screenshot:

There's more...
..................Content has been hidden....................

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