Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Start a free Basic trial
to watch this video
Working with a specific module called the Contact module allows you to build email forms for users to contact each other, or the site admin.
-
0:00
In this video, we're going to use our first module called the contact module
-
0:05
to build Cameron his email form.
-
0:08
The contact module is a core module, so it was included in the Drupal core code
-
0:13
that we downloaded at the beginning of the course to start our project.
-
0:17
All we need to do is enable it and configure it.
-
0:19
First, open the module administration page,
-
0:23
by clicking Modules in the Management menu.
-
0:27
You'll see a list of all the modules currently included in your project.
-
0:33
Modules can be easily enabled or disabled.
-
0:36
Sometimes you'll turn off one or
-
0:38
more modules as you hunt down bugs in your Dribble site.
-
0:42
In addition, too many modules can slow down your site's performance.
-
0:47
So be careful when you enable a module and
-
0:49
just know that it's really easy to disable a module too.
-
0:53
You can see a check box for
-
0:54
this purpose next to each module's name on the far left of each module's row.
-
1:00
You can also see a description of the module's functionality and
-
1:04
the version number in the middle of each row.
-
1:08
The column labeled OPERATIONS, on the right,
-
1:11
is where you find each modules individual options and documentation.
-
1:16
Let's enable the Contact module.
-
1:19
Scroll down the module Administration page until you see one with the name Contact.
-
1:25
Enable it by clicking its check box, and
-
1:28
then scroll to the bottom of the screen and click Save configuration.
-
1:34
Now, we can look under Contact in the OPERATIONS column and
-
1:39
click on the Help link to read the documentation.
-
1:43
And then, we can set up the options specific to the Contact
-
1:48
module by clicking on its link labeled Configure.
-
1:53
The Administration page for
-
1:55
the Contact module holds a table with information about the form.
-
1:59
The first column on the left is labeled CATEGORY.
-
2:03
Each item added to this column will be an option available in a drop down menu
-
2:08
on our form.
-
2:09
This way, a user can tell us if they are contacting us about ordering coffee, or
-
2:14
just sending us feedback on the new website, or anything else we want.
-
2:18
The default category is called Website Feedback.
-
2:22
Let's configure this by clicking on it's Edit link.
-
2:28
Now we can see that the Category name is defined in the first field.
-
2:33
And your admin email has been listed under Recipients.
-
2:37
Let's change that to Cameron's email.
-
2:43
Then, we can add the auto reply in the third field.
-
2:48
We'll have it say, Thank you for your feedback!
-
2:51
We will respond to you within the next 2 days.
-
2:56
Now, click Save.
-
3:00
Let's create the second category, for
-
3:02
people who want to order coffee, instead of give feedback on the website.
-
3:07
Click the Add Category link.
-
3:10
In the first field, give the category the name Coffee Order.
-
3:16
Then, we'll add Elaine's email into the Recipients field.
-
3:24
And we'll add the other auto-reply message.
-
3:28
This one will say, Thank you for your order!
-
3:32
Orders usually ship within 3-5 business days.
-
3:36
Click Save, and we are done creating the form.
-
3:41
Some modules automatically create menu links for you.
-
3:44
But, as stated in its configure page, the contact menu item is disabled by default.
-
3:50
Let's fix this by customizing our menu links on the menu Administration page.
-
3:55
We could get there by clicking on this link, or
-
3:58
we can always go to Structure in the Management menu.
-
4:03
And then click Menus.
-
4:06
Inside of the Menu administration page,
-
4:09
you can edit the four menus that we've working with so far.
-
4:12
Main, Management, Navigation, and
-
4:16
User, or you can create your own by clicking the Add Menu link.
-
4:22
We're going to place a link to contact in the main menu and
-
4:26
it should take any user to our contact form.
-
4:29
But first we have to enable the Contact Menu item.
-
4:33
The configure page for the Contact module gave us some instructions about this.
-
4:38
It said that the Contact Menu item is in the navigation menu by default,
-
4:44
so we know where to look for it.
-
4:46
Back in the Menus administration page, click List Links,
-
4:50
next to the Navigation menu.
-
4:53
Find the disabled Contact menu item in the list and click on its edit link.
-
5:01
Set the Menu link title to Contact, and
-
5:04
the description to something like, Chat with Cameron.
-
5:10
Make sure to check the Enabled check box.
-
5:13
And let's set its parent link to the
, which you'll find right at the top. -
5:21
Let's leave the Weight alone, and we'll click Save.
-
5:25
And after saving, we're taken to a view of the links in the Main menu.
-
5:29
And now you can see that Contact is there, next to About Us and Home.
-
5:35
Another thing we can do in these Menu administration pages
-
5:38
is change the order of Menu links, manually, by dragging and
-
5:42
dropping them using the arrows on the far left of each row.
-
5:46
For example, let's put Home at the top, so that it's the first item in the Main menu.
-
5:51
Just click on the crisscrossed arrows on the left of the Home row and
-
5:55
drag the whole row to the top.
-
5:58
Click Save configuration and then click back to Home.
-
6:02
Hooray!
-
6:05
Now, Home is the first tab, and there's a tab for our new Contact form.
You need to sign up for Treehouse in order to download course files.
Sign up