Creating a campaign/petition with a registration form
This page is a tutorial on how to add a simple campaign content type using Drupal out of the box in combination with the Entity Registration module. For this you don't even have to have the Engage module installed since it is more of a methodology rather then explicit functionality provided by Engage. The Entity registration module allows site developers to attach a registration field to any entity. For example, in our use case we will be attaching it to a campaign node so that the form will show up on campaign pages and allow people to sign that campaign/petition. Since each form that is filled out is stored as a registration entity it allows us to track campaign signatures for such things as social proof (how much support a campaign/petition has), statistical analysis, etc.
The goal of this tutorial
Simply put:
to allow site administrators to add pages to the site that act as a campaign/petition with the functionality of allowing people to sign the campaign/petition.
Tutorial
Follow these 8 steps to set up a campaign content type that collects signatures:
Step 1
Make sure you have installed and configured Drupal with the node and field modules enabled and are knowledgeable about content types in Drupal. If not then you should read the following sections:
Step 2
Create a new content type called "Campaign" or a similar term of your preference.
Step 3
Download and install the Entity registration module.
Step 4
Create a new "Campaign Registration" registration type (/admin/structure/registration/registration_types/add). You just need to give it a label and click "Save registration type". Once the new registration type is saved you will see it in the list of registration types. It will have options to edit, manage fields, manage display, clone, delete and export. Substantial documentation on the Entity registration may be found under its project documentation pages.
Step 5
Add fields to the registration form by click on the "manage fields" link beside your new registration type. The instructions for managing fields from Step 1 above apply to adding fields to the registration type as well. It uses the field ui as any standard fieldable entity in Drupal 7 does.
Step 6
Go to the "manage fields" section for the content type you created in step 2 above. If the machine name of your content type is campaign then the url should be /admin/structure/types/manage/campaign/fields.
Add a new field of type "Registration". Lets pretend we call it "Sign our petition"
Set any default settings for the registration you would like all new campaigns to have. For example checking the box beside "Enable" so that the registration link and/or form will show up and be enabled for accepting registrations. Read the documentation for the Entity registration module to better understand what all the various settings are.
Step 7
Configure the display settings for the content type you created in step 2 above. If the machine name of your content type is campaign then the url should be /admin/structure/types/manage/campaign/display. Drag your registration field to a region that is displayed. Select "Registration Link" to display the field as a link to the registration page (you may wish to do this if say you want to theme the link as a button "Sign our petition") or "Registration form" if you would like the form embedded in the directly on the campaign page.
Step 8
Configure the permissions for your registration type and field. You need to grant access to roles explicitly to allow people with varying access levels to use the registration form. In particular if you would like anonymous users to be able to sign your petitions then you will need to grant the anonymous role the following permissions: Campaign registration: Create new registration, and Campaign registration: Register other people.
That is essentially all there is to setting it up. You should now be able to create a campaign node, select the "campaign registration" type while creating the new campaign node and publish it and see your new campaign. There is obviously some themeing you need to do and make sure to configure the registration setting attached to each particular campaign node. You should see a "manage registrations" tab when viewing the campaign page and logged in with the correct permissions. Otherwise the link to manage the registration settings is /node/<node id>/registrations.
Some other helpful hints
Manage the display of registrations
Just like nodes you can manage how registrations (the stored form submission by someone signing your campain) are displayed. Remember the links listed in Step 4 above, click "manage display". This will allow you to customize which fields get displayed when an admin is reviewing a registration. Also, helpful if you want to display lists of registrations in a view or using some other mechanism via rendering the entity.
Additional useful modules
There are tons of other helpful modules that allow you to customize your site, but here are a few in particular that will be very helpful in customizing your campaign/petition/registration pages, forms, interface:
- Display suite - will allow you to set up custom layouts for both your campaign pages and the registration form.
- Views - will allow you to create custom reports for filtering/analysing the success of your campaigns.
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion