You are here

page.html.twig in Open Social 8.2

Socialbase's theme implementation to display a page.

The doctype, html, head and body tags are not in this template. Instead they can be found in the html.html.twig template normally located in the core/modules/system 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.

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

  • 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).

File

themes/socialbase/templates/layout/page.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Socialbase's theme implementation to display a 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 normally located in the
  8. * core/modules/system directory.
  9. *
  10. * Available variables:
  11. *
  12. * General utility variables:
  13. * - base_path: The base URL path of the Drupal installation. Will usually be
  14. * "/" unless you have installed Drupal in a sub-directory.
  15. * - is_front: A flag indicating if the current page is the front page.
  16. * - logged_in: A flag indicating if the user is registered and signed in.
  17. * - is_admin: A flag indicating if the user has permission to access
  18. * administration pages.
  19. *
  20. * Site identity:
  21. * - front_page: The URL of the front page. Use this instead of base_path when
  22. * linking to the front page. This includes the language domain or prefix.
  23. *
  24. * Page content (in order of occurrence in the default page.html.twig):
  25. * - node: Fully loaded node, if there is an automatically-loaded node
  26. * associated with the page and the node ID is the second argument in the
  27. * page's path (e.g. node/12345 and node/12345/revisions, but not
  28. * comment/reply/12345).
  29. *
  30. *
  31. * @see template_preprocess_page()
  32. * @see html.html.twig
  33. */
  34. #}
  35. {% if page.header %}
  36. {{ page.header }}
  37. {% endif %}
  38. <main id="content" class="main-container" role="main">
  39. {% if page.breadcrumb %}
  40. {{ page.breadcrumb }}
  41. {% endif %}
  42. {% if page.hero %}
  43. {{ page.hero }}
  44. {% endif %}
  45. {% if page.secondary_navigation %}
  46. {{ page.secondary_navigation }}
  47. {% endif %}
  48. {% if page.content_top %}
  49. {{ page.content_top }}
  50. {% endif %}
  51. {# Content attributes, see Style guide Templates for documentation #}
  52. {% block section %}
  53. <section{{ content_attributes }}>
  54. {% if page.title and display_page_title %}
  55. {{ page.title }}
  56. {% endif %}
  57. {% if page.complementary_top or page.complementary_bottom %}
  58. <aside class="region--complementary" role="complementary">
  59. {% if page.complementary_top %}
  60. {{ page.complementary_top }}
  61. {% endif %}
  62. {% if page.complementary_bottom %}
  63. {{ page.complementary_bottom }}
  64. {% endif %}
  65. </aside>
  66. {% endif %}
  67. {% block content %}
  68. <a id="main-content" tabindex="-1"></a>
  69. {{ page.content }}
  70. {% endblock %}
  71. {# an extra check for complementary regions to be empty #}
  72. {% if page.sidebar_first and not page.complementary_top and not page.complementary_bottom %}
  73. {% block sidebar_first %}
  74. {{ page.sidebar_first }}
  75. {% endblock %}
  76. {% endif %}
  77. {# an extra check for complementary regions to be empty #}
  78. {% if page.sidebar_second and not page.complementary_top and not page.complementary_bottom %}
  79. {% block sidebar_second %}
  80. {{ page.sidebar_second }}
  81. {% endblock %}
  82. {% endif %}
  83. </section>
  84. {% endblock %}
  85. {% if page.content_bottom %}
  86. {{ page.content_bottom }}
  87. {% endif %}
  88. </main>
  89. {% if page.footer %}
  90. {{ page.footer }}
  91. {% endif %}