Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Elsewhere in this course, I showed you that Drupal Gardens comes with a simple contact form built in, and you can get to it by clicking Contact in this particular template. And you saw how to make a small change by adding this Category menu down here. Now I am going to show you a way to collect information that's much, much more flexible. It's called Webforms, which is turned off by default. So first we have to turn it on by going up to Modules, closing up our CORE group to get down there more quickly, scroll to the bottom, and turn on Webforms, and Save configuration.
Turning that on adds a content type called, obviously enough, Webforms. To create a feedback form, you just add a node of the Webform content type. So we go up to Add content and Webform. And I'll fill this out. The Title will be Your dream California vacation. These items on the left are fields that you can add to your Webform. You simply drag them in like this. Once you've dragged them in, when you click on one, you see the Field settings.
So you can change the Labels and all the other different options that go along with it, or you could delete them simply by clicking Delete next to each one. So I am going to start building my form. Go back over to Add field, and first I am going to add a Fieldset. You will see what this means when we actually go back and look at our Webform as a user filling it out. So for the Fieldset, I will say, "First, tell us about yourself," and I'll add some radio buttons. Why not? Again, you can change all of the settings here. Where are you coming from? And add some options here. Let's say Eastern U.S., Central U.S., Western U.S., and add an item and say Outside the U.S.
And by default, since most or our visitors are from the Western U.S., I will change the default. This is just to give you a sense of all the different things that you can do, because there are quite a lot. We'll add another few fields here. When I added this one, I thought I would just give people a short answer, but now that I think about it, I'll make it longer.
So instead of being a single line, I'll add a Multi-line text field. Who'll be traveling with you? Very good! You can also add an E-mail field. And you can even add a Page break so you have Multi-page forms.
Then I will add something on the second page here. Great, that looks pretty good. So we will save it by going all the way down to the bottom and saying Publish. And there it is. As you can see, it's easy for somebody to fill out. If we go back and edit it, you'll see that there are some other form settings that I sort of glossed over here. You can make it a menu selection. When you change it, you could add a revision to keep track of all of the different changes that you make to the form.
You can limit submissions so that people can only turn into one submission or five submissions or something like that-- very good for contests. And you can even have it send you a conformation e-mail whenever somebody completes the webform. The only thing that I think I'll do is I'll un-promote it from the front page. I don't really want it appearing on the front page. And then we'll save it. I think I'll actually go ahead and fill this in and see what it looks like after we get some answers in. So I am coming from the Central U.S. I'll travel alone.
My e-mail address is email@example.com. And then you see, since we put in this page break, we click Next Page, and I want to go "Everywhere in California!" and then Submit. Terrific! Now, since we are the Administrator, we can actually look and see what people turned in there. So we go back to the Form, and now we see this tab here that says Results. There are several things that we could do here. We could simply view them, in which case we see all of the answers here.
And by the way, if the user happened to have a picture that went with their account, we'd see that here as well. Going back a bit. We can also edit it to change the answers, or we can download the entire file. There are also some options for analysis. If several people had answered, of course we start to get a sense of what the most popular answers were, and where people are coming from, and then we could change our marketing based on that webform result. So you can see how powerful webforms can be, but the truth is, we've only barely scratched the surface, because there are a lot of additional settings that extend it even further.
You can see those if you go up to Configuration and then down to Webform settings, which is right over here. You can enable all your content types so that not only do the questions appear on webforms, but as parts of tours, for example, or anything else. You can allow people to add certain field types but not other field types as they design forms, and then it just goes on and on, lots of interesting things you can do with these. And after all this, you might ask, why even bother with the contact form? Well, the two can be used to serve slightly different purposes.
For example, you could allow logged-in members to reach you through the contact form, but force anonymous users to give you extra information through a webform in order to reach you. In any case, the webform system is an amazing addition to Drupal Gardens. Its flexibility in both input and data export opens up a world of feedback possibilities.
Get unlimited access to all courses for just $25/month.Become a member