0

I'm fairly new to drupal and this is my first time posting on stackexchange. Constructive critisism and feedback are more than welcome.

All regions in my custom theme are placed inside the body tag from html.html.twig file. Is there any way to create a region that is located underneath the body?

The markup should look something like this:

<header>header region block(s)</header>
<body>...</body>
<footer>footer region block(s)</footer>

Right now the way it's rendered it looks like this:

<body>
 <header>header region block(s)</header>
  ...
 <footer>footer region block(s)</footer>
</body>

I'm on drupal 8.6. Thanks in advance, Geordi

  • Already tried the answer to this question Insert region into html.html.twig but to no avail. Using this is was able to call the region in the html.html.twig file but it was still being rendered inside the body tag. – Geordi Feijens May 1 '19 at 13:22
1

Best practice dictates that you should not put the header or footer outside of the body tag. All visible content on your site goes inside the body tag.

Correct HTML syntax looks like this (here is a basic example):

<head>
  <title>My Drupal site</title>
  <!-- Other metadata goes here -->
</head>
<body>
  <header>
    <!-- Top of the page content goes here -->
  </header>
  <section>
    <!-- Main body content goes here -->
  </section>
  <footer>
    <!-- Footer content goes here -->
  </footer>
</body>

See this page for some extra details https://www.w3schools.com/html/html5_semantic_elements.asp

I know this doesn't technically anwer your question, but I feel this is a "correct" response in regards to what information will be most helpful.

| improve this answer | |
  • 1
    Will look into it, thank you very much! – Geordi Feijens May 2 '19 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.