You are here

html.html.twig in Drupal 10

Theme override for the basic structure of a single Drupal page.

Variables:

  • logged_in: A flag indicating if user is logged in.
  • root_path: The root path of the current page (e.g., node, admin, user).
  • node_type: The content type for the current node, if the page is a node.
  • head_title: List of text elements that make up the head_title variable. May contain one or more of the following:

    • title: The title of the page.
    • name: The name of the site.
    • slogan: The slogan of the site.
  • page_top: Initial rendered markup. This should be printed before 'page'.
  • page: The rendered page markup.
  • page_bottom: Closing rendered markup. This variable should be printed after 'page'.
  • db_offline: A flag indicating if the database is offline.
  • placeholder_token: The token for generating head, css, js and js-bottom placeholders.

File

core/themes/stable/templates/layout/html.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override for the basic structure of a single Drupal page.
  5. *
  6. * Variables:
  7. * - logged_in: A flag indicating if user is logged in.
  8. * - root_path: The root path of the current page (e.g., node, admin, user).
  9. * - node_type: The content type for the current node, if the page is a node.
  10. * - head_title: List of text elements that make up the head_title variable.
  11. * May contain one or more of the following:
  12. * - title: The title of the page.
  13. * - name: The name of the site.
  14. * - slogan: The slogan of the site.
  15. * - page_top: Initial rendered markup. This should be printed before 'page'.
  16. * - page: The rendered page markup.
  17. * - page_bottom: Closing rendered markup. This variable should be printed after
  18. * 'page'.
  19. * - db_offline: A flag indicating if the database is offline.
  20. * - placeholder_token: The token for generating head, css, js and js-bottom
  21. * placeholders.
  22. *
  23. * @see template_preprocess_html()
  24. */
  25. #}
  26. <!DOCTYPE html>
  27. <html{{ html_attributes }}>
  28. <head>
  29. <head-placeholder token="{{ placeholder_token|raw }}">
  30. <title>{{ head_title|safe_join(' | ') }}</title>
  31. <css-placeholder token="{{ placeholder_token|raw }}">
  32. <js-placeholder token="{{ placeholder_token|raw }}">
  33. </head>
  34. <body{{ attributes }}>
  35. {#
  36. Keyboard navigation/accessibility link to main content section in
  37. page.html.twig.
  38. #}
  39. <a href="#main-content" class="visually-hidden focusable">
  40. {{ 'Skip to main content'|t }}
  41. </a>
  42. {{ page_top }}
  43. {{ page }}
  44. {{ page_bottom }}
  45. <js-bottom-placeholder token="{{ placeholder_token|raw }}">
  46. </body>
  47. </html>