Homepage content type
Exercise: Building a Homepage content type
We'll build a new content type which we will use to build the homepage with all of its components shown in our design.
From Drupal's Admin Toolbar, click Structure | Content Types
Click the **Add content type **button
In the name field type Homepage
Click the Save and manage fields button at the bottom of the page
Delete the **body **field
Exercise: Adding the Hero field to the Homepage
While still in the Homepage content type, click the Add field button
Under the Add a new field dropdown, scroll to the Reference section and select Content
LabelMachine nameHero
field_hero
Click the Save and continue button
Change Allowed number of values_ to Limited - 1
In the Reference Type section, choose Article under Content type
Click the Save settings button
Exercise: Create a new Node with a Hero
Using the Homepage content type, create a new node and add a Hero component in it:
From Drupal's Admin toolbar, click Content
Click the Add content button
Select Homepage
As the Page title type** Homepage**
In the Hero field, begin typing any characters and as article suggestions begin to display, select an article of your choice
Click the **Save **button
The above exercise will create a node of type Homepage, with an article as the Hero. It is clear we have more work to do since the Hero article does not look like a Hero at all. We will clean things up in the following exercises.\
It's pretty obvious there are a lot of things that need improvement with our Hero, but we will get to that shortly.
Last updated