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: Add the Hero paragraph 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 revisions section and select Paragraph

Label
Machine name

Hero banner

field_hero_banner

  • Click the Save and continue button

  • Type of item to reference Paragraph

  • Change Allowed number of values_ to Limited - 1

  • In the Reference Type section, choose Hero under Paragraph types

  • 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

  • Complete the Hero banner field by adding a Heading (2-3 words), upload an image, and for the Link field use '/' for the URL and 'Learn More' for the Link text. We will come back to this a bit later.

  • Click the Save button

The above exercise will create a node of type Homepage, with a paragraph 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.

Drupal Node with Hero

Last updated