Creating our homepage

The next item we will move on to is creating the main homepage template. By default, Drupal uses the page.html.twig template to render any regions we have defined within our configuration. Because we broke out our Mockup into functional areas, we have a sense of what each region will contain. Our job is to recreate the homepage, which will require us to follow these basic theming techniques.

  1. First, we will take advantage of Drupal's file name suggestions to create our homepage template.
  2. Then, we will replace the contents of our template with the contents of our Mockups homepage.
  3. Finally, we will need to review the output of our new template.

Using page templates

If we inspect the homepage, it is currently using the core page.html.twig ...

Get Drupal 8 Theming with Twig now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.