Adding a Drupal Webform to the Event Content Type
Have you ever wanted to add a signup form to your free events? The Webform module, which has been around Drupal for a while is a great option. The following is a simple recipe of modules and configuration that will allow you to add a signup form to your event content type ... or any other content type of course. The following steps assume you are logged into a default Drupal7 site.
Event Content Type
- Click on Structure in the black menu bar across the top of the screen.
- Click on Content types > Add content type.
- Create the event content type by completing the form. Add additional fields such as a location and date is you want.
Note: We will return to this content type to finish its configuration.
- Install and enable the Webform module.
- Configure the Webform module by checking the Event content type from the list of content types on the configuration page.
- Click on Add content in the gray shortcut bar.
- Click Webform.
- Title the node Generic Signup, turn off comments if you want to, and Save.
- Add the components you want for your signup form and configure the form using the configuration options provided by the Webform module.
- Make sure you save.
Webform Template Module
- Install and enable the Webform template module.
- Click on configure next to the module on the module list.
- Select Event for the template destination.
- Select Webform for the template source.
Note: This configuration is not the only way to do this. It's just what you need for what is being described in this blog.
Field Group Module
- Install and enable the Field group module.
- Go to Structure > Content types > Manage fields for the Event content type.
- Add a new field group labeled Sign Up and set to fieldset.
- Drag the Webform template (that already appears in your list of fields) to be a child item under the group.
- Drag the group to a position of your choosing.
- Click on Manage display tab at the top of the Manage fields page.
- Position the Sign up group to a place of your choosing. Consider the Div format but that's your choice.
- Click on Add content > Event.
- Create an event.
- Select the sign up form from the template list.