html.html.twig

Default theme implementation for the basic structure of a single Drupal page.

Variables:

  • css: A list of CSS files for the current page.
  • head: Markup for the HEAD element (including meta tags, keyword tags, and so on).
  • head_title: A modified version of the page title, for use in the TITLE tag.
  • head_title_array: List of text elements that make up the head_title variable. May contain 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'.
  • styles: Style tags necessary to import all necessary CSS files in the head.
  • scripts: Script tags necessary to load the JavaScript files and settings in the head.

See also

template_preprocess()

template_preprocess_html()

template_process_html()

File

drupal/core/modules/system/templates/html.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for the basic structure of a single Drupal page.
  5. *
  6. * Variables:
  7. * - css: A list of CSS files for the current page.
  8. * - head: Markup for the HEAD element (including meta tags, keyword tags, and
  9. * so on).
  10. * - head_title: A modified version of the page title, for use in the TITLE tag.
  11. * - head_title_array: List of text elements that make up the head_title
  12. * variable. May contain or more of the following:
  13. * - title: The title of the page.
  14. * - name: The name of the site.
  15. * - slogan: The slogan of the site.
  16. * - page_top: Initial rendered markup. This should be printed before 'page'.
  17. * - page: The rendered page markup.
  18. * - page_bottom: Closing rendered markup. This variable should be printed after
  19. * 'page'.
  20. * - styles: Style tags necessary to import all necessary CSS files in the head.
  21. * - scripts: Script tags necessary to load the JavaScript files and settings
  22. * in the head.
  23. *
  24. * @see template_preprocess()
  25. * @see template_preprocess_html()
  26. * @see template_process_html()
  27. *
  28. * @ingroup themeable
  29. */
  30. #}
  31. <!DOCTYPE html>
  32. <html{{ html_attributes }}>
  33. <head>
  34. {{ head }}
  35. <title>{{ head_title }}</title>
  36. {{ styles }}
  37. {{ scripts }}
  38. </head>
  39. <body{{ attributes }}>
  40. <div id="skip-link">
  41. <a href="#main-content" class="element-invisible element-focusable">
  42. {{ 'Skip to main content'|t }}
  43. </a>
  44. </div>
  45. {{ page_top }}
  46. {{ page }}
  47. {{ page_bottom }}
  48. </body>
  49. </html>

Related topics