html.html.twig 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation 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. * - css: A list of CSS files for the current page.
  11. * - head: Markup for the HEAD element (including meta tags, keyword tags, and
  12. * so on).
  13. * - head_title: A modified version of the page title, for use in the TITLE tag.
  14. * - head_title_array: List of text elements that make up the head_title
  15. * variable. May contain or more of the following:
  16. * - title: The title of the page.
  17. * - name: The name of the site.
  18. * - slogan: The slogan of the site.
  19. * - page_top: Initial rendered markup. This should be printed before 'page'.
  20. * - page: The rendered page markup.
  21. * - page_bottom: Closing rendered markup. This variable should be printed after
  22. * 'page'.
  23. * - styles: Style tags necessary to import all necessary CSS files in the head.
  24. * - scripts: Script tags necessary to load the JavaScript files and settings
  25. * in the head.
  26. * - db_offline: A flag indicating if the database is offline.
  27. *
  28. * @see template_preprocess_html()
  29. *
  30. * @ingroup themeable
  31. */
  32. #}
  33. <!DOCTYPE html>
  34. {% if ie_enabled_versions.ie8 %}
  35. {{- attach_library('basic/ie8') }}
  36. {% endif %}
  37. {% if ie_enabled_versions.ie9 or ie_enabled_versions.ie8 %}
  38. <!--[if lt IE 7]> <html{{ html_attributes.addClass('no-js', 'lt-ie9', 'lt-ie8', 'lt-ie7') }}><![endif]-->
  39. <!--[if IE 7]> <html{{ html_attributes.removeClass('lt-ie7') }}><![endif]-->
  40. <!--[if IE 8]> <html{{ html_attributes.removeClass('lt-ie8') }}><![endif]-->
  41. <!--[if gt IE 8]><!--><html{{ html_attributes.removeClass('lt-ie9') }}><!--<![endif]-->
  42. {% else -%}
  43. <html{{ html_attributes }}>
  44. {% endif %}
  45. <head>
  46. <head-placeholder token="{{ placeholder_token }}">
  47. <title>{{ head_title|safe_join(' | ') }}</title>
  48. <css-placeholder token="{{ placeholder_token }}">
  49. <js-placeholder token="{{ placeholder_token }}">
  50. </head>
  51. {% set classes = [] %}
  52. {% for role in user.roles %}
  53. {% set classes = classes|merge(['role--' ~ role|clean_class]) %}
  54. {% endfor %}
  55. {% set sidebar_first = page.sidebar_first|render %}
  56. {% set sidebar_second = page.sidebar_second|render %}
  57. <body{{ attributes.addClass(classes,
  58. not is_front ? 'with-subnav',
  59. sidebar_first ? 'sidebar-first',
  60. sidebar_second ? 'sidebar-second',
  61. (sidebar_first and not sidebar_second) or (sidebar_second and not sidebar_first) ? 'one-sidebar',
  62. (sidebar_first and sidebar_second) ? 'two-sidebars',
  63. (not sidebar_first and not sidebar_second) ? 'no-sidebar'
  64. ) }}>
  65. <div id="skip">
  66. <a href="#main-menu" class="visually-hidden focusable skip-link">
  67. {{ 'Skip to main navigation'|t }}
  68. </a>
  69. </div>
  70. {{ page_top }}
  71. {{ page }}
  72. {{ page_bottom }}
  73. <js-bottom-placeholder token="{{ placeholder_token }}">
  74. {% if browser_sync.enabled %}
  75. <script id="__bs_script__">
  76. document.write("<script async src='http://{{ browser_sync.host }}:{{ browser_sync.port }}/browser-sync/browser-sync-client.js'><\/script>".replace("HOST", location.hostname));
  77. </script>
  78. {% endif %}
  79. </body>
  80. </html>