You are here

page.html.twig in Zircon Profile 8

Default theme implementation to display a single page.

The doctype, html, head and body tags are not in this template. Instead they can be found in the html.html.twig template in this directory.

Available variables:

General utility variables:

  • base_path: The base URL path of the Drupal installation. Will usually be "/" unless you have installed Drupal in a sub-directory.
  • is_front: A flag indicating if the current page is the front page.
  • logged_in: A flag indicating if the user is registered and signed in.
  • is_admin: A flag indicating if the user has permission to access administration pages.

Site identity:

  • front_page: The URL of the front page. Use this instead of base_path when linking to the front page. This includes the language domain or prefix.
  • logo: The url of the logo image, as defined in theme settings.
  • site_name: The name of the site. This is empty when displaying the site name has been disabled in the theme settings.
  • site_slogan: The slogan of the site. This is empty when displaying the site slogan has been disabled in theme settings.

Page content (in order of occurrence in the default page.html.twig):

  • messages: Status and error messages. Should be displayed prominently.
  • node: Fully loaded node, if there is an automatically-loaded node associated with the page and the node ID is the second argument in the page's path (e.g. node/12345 and node/12345/revisions, but not comment/reply/12345).

Regions:

  • page.header: Items for the header region.
  • page.primary_menu: Items for the primary menu region.
  • page.secondary_menu: Items for the secondary menu region.
  • page.highlighted: Items for the highlighted content region.
  • page.help: Dynamic help text, mostly for admin pages.
  • page.content: The main content of the current page.
  • page.sidebar_first: Items for the first sidebar.
  • page.sidebar_second: Items for the second sidebar.
  • page.footer: Items for the footer region.
  • page.breadcrumb: Items for the breadcrumb region.

File

core/modules/system/templates/page.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display a single page.
  5. *
  6. * The doctype, html, head and body tags are not in this template. Instead they
  7. * can be found in the html.html.twig template in this directory.
  8. *
  9. * Available variables:
  10. *
  11. * General utility variables:
  12. * - base_path: The base URL path of the Drupal installation. Will usually be
  13. * "/" unless you have installed Drupal in a sub-directory.
  14. * - is_front: A flag indicating if the current page is the front page.
  15. * - logged_in: A flag indicating if the user is registered and signed in.
  16. * - is_admin: A flag indicating if the user has permission to access
  17. * administration pages.
  18. *
  19. * Site identity:
  20. * - front_page: The URL of the front page. Use this instead of base_path when
  21. * linking to the front page. This includes the language domain or prefix.
  22. * - logo: The url of the logo image, as defined in theme settings.
  23. * - site_name: The name of the site. This is empty when displaying the site
  24. * name has been disabled in the theme settings.
  25. * - site_slogan: The slogan of the site. This is empty when displaying the site
  26. * slogan has been disabled in theme settings.
  27. *
  28. * Page content (in order of occurrence in the default page.html.twig):
  29. * - messages: Status and error messages. Should be displayed prominently.
  30. * - node: Fully loaded node, if there is an automatically-loaded node
  31. * associated with the page and the node ID is the second argument in the
  32. * page's path (e.g. node/12345 and node/12345/revisions, but not
  33. * comment/reply/12345).
  34. *
  35. * Regions:
  36. * - page.header: Items for the header region.
  37. * - page.primary_menu: Items for the primary menu region.
  38. * - page.secondary_menu: Items for the secondary menu region.
  39. * - page.highlighted: Items for the highlighted content region.
  40. * - page.help: Dynamic help text, mostly for admin pages.
  41. * - page.content: The main content of the current page.
  42. * - page.sidebar_first: Items for the first sidebar.
  43. * - page.sidebar_second: Items for the second sidebar.
  44. * - page.footer: Items for the footer region.
  45. * - page.breadcrumb: Items for the breadcrumb region.
  46. *
  47. * @see template_preprocess_page()
  48. * @see html.html.twig
  49. *
  50. * @ingroup themeable
  51. */
  52. #}
  53. <div class="layout-container">
  54. <header role="banner">
  55. {{ page.header }}
  56. </header>
  57. {{ page.primary_menu }}
  58. {{ page.secondary_menu }}
  59. {{ page.breadcrumb }}
  60. {{ page.highlighted }}
  61. {{ page.help }}
  62. <main role="main">
  63. <a id="main-content" tabindex="-1"></a>{# link is in html.html.twig #}
  64. <div class="layout-content">
  65. {{ page.content }}
  66. </div>{# /.layout-content #}
  67. {% if page.sidebar_first %}
  68. <aside class="layout-sidebar-first" role="complementary">
  69. {{ page.sidebar_first }}
  70. </aside>
  71. {% endif %}
  72. {% if page.sidebar_second %}
  73. <aside class="layout-sidebar-second" role="complementary">
  74. {{ page.sidebar_second }}
  75. </aside>
  76. {% endif %}
  77. </main>
  78. {% if page.footer %}
  79. <footer role="contentinfo">
  80. {{ page.footer }}
  81. </footer>
  82. {% endif %}
  83. </div>{# /.layout-container #}

Related topics