This course will be retired on February 24, 2020.
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
Creating specialized content types tailored to the specific goal of your website is a powerful Drupal feature.
Key Steps to Creating Custom Content
- To start making your own custom content type, click on the “Structure” link in the Management Menu, and then select “Content Types”.
- Then, click on “Add content type”. Here you can fill out a form to define its name, description, and other settings. This lets you control things like how the submission form is laid out.
- When you finish with that page, you can click on ‘Save and add fields’ to create custom fields for your content type, like a dropdown menu or a price field.
- When you are finished creating your custom content type, you can use it by clicking on ‘Add content’, just like normal. Your new custom content type will appear side by side with the defaults of ‘Basic Page’ and ‘Article.’
-
0:00
Let's try it out.
-
0:01
Click the add content link and
-
0:04
here we can click on our new custom content type, Coffee Import.
-
0:10
Let's make one.
-
0:12
It's name is going to be Treehouse Blend.
-
0:15
And the description, oh I don't know.
-
0:20
An exotic blend of flavors
-
0:25
you are bound to learn from.
-
0:32
And we'll scroll down and see, there's our Locale field.
-
0:36
We'll say that it's [LAUGH] from Portland, OR.
-
0:43
And the price will be a very reasonable $8 per pound.
-
0:49
Finally, we get to select a roast, and we'll say that's a medium roast.
-
0:55
We can leave all of this stuff alone, and then click Save.
-
1:00
And here we are, our new Treehouse Blend, a beautiful coffee import display.
-
1:06
Let's make another one for practice.
-
1:09
You should make a few, because we will end up using these later.
-
1:12
So again, I go to the Add Content link.
-
1:15
Select Coffee Import and the name will be Batman Blend.
-
1:24
It is dark as the night.
-
1:29
The locale would, of course, be Gotham.
-
1:33
And the price is a little steeper on this one.
-
1:36
$16 per pound.
-
1:38
And, of course the roast would have to be dark.
-
1:41
Let's click save, and now if we go to our front page,
-
1:46
we can see both of our new coffee imports.
-
1:50
Creating specialized content types
-
1:53
tailored to the specific goal of your website is a powerful Drupal feature.
-
1:58
Perhaps a photographer's portfolio website would include custom content types for
-
2:03
fancy portraits and panorama photography, since each might include
-
2:08
different information which you want displayed in different ways.
-
2:13
Studio portrait's would have to include the person's name,
-
2:16
while a panoramic nature photograph would need to have the pictures location, and
-
2:21
maybe even the time of day and the settings on the camera.
-
2:26
Drupal allows you to get as specific as you need to, because even though we
-
2:31
are making custom content types, with fields beyond the usual title and
-
2:36
description, each of them is just another node.
You need to sign up for Treehouse in order to download course files.
Sign up