Creating our interior page template

Drupal provides us with multiple ways to address templating a specific page. As we saw when we created our homepage, we can take advantage of Twig debugging to identify which templates are being output. The same is true for our interior pages. If we navigate to the About Us page and inspect the markup we can identify that Drupal is using the default page.html.twig template, as shown in the following image:

Creating our interior page template

This template is clearly different than the page--front.html.twig template we created earlier, which explains why some of our page elements are missing. However, this is a good example of how we can use different Twig templates to control the markup.

Begin by following these steps:

  1. Navigate to the core/modules/system/templates folder and copy page.html.twig.
  2. Place the copy within our themes/octo/templates folder.

Make sure to clear Drupal's cache and refresh the About Us page. If we inspect the page again, we will note that our new template is being used. We can now begin to modify the markup safely.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.69.163