You are here

seeds-toolbar.html.twig in Seeds Toolbar 8

Theme override for the administrative toolbar.

Available variables:

  • attributes: HTML attributes for the wrapper.
  • toolbar_attributes: HTML attributes to apply to the toolbar.
  • toolbar_heading: The heading or label for the toolbar.
  • tabs: List of tabs for the toolbar.
    • attributes: HTML attributes for the tab container.
    • link: Link or button for the menu tab.
  • trays: Toolbar tray list, each associated with a tab. Each tray in trays contains:

    • attributes: HTML attributes to apply to the tray.
    • label: The tray's label.
    • links: The tray menu links.
  • remainder: Any non-tray, non-tab elements left to be rendered.

File

templates/seeds-toolbar.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override for the administrative toolbar.
  5. *
  6. * Available variables:
  7. * - attributes: HTML attributes for the wrapper.
  8. * - toolbar_attributes: HTML attributes to apply to the toolbar.
  9. * - toolbar_heading: The heading or label for the toolbar.
  10. * - tabs: List of tabs for the toolbar.
  11. * - attributes: HTML attributes for the tab container.
  12. * - link: Link or button for the menu tab.
  13. * - trays: Toolbar tray list, each associated with a tab. Each tray in trays
  14. * contains:
  15. * - attributes: HTML attributes to apply to the tray.
  16. * - label: The tray's label.
  17. * - links: The tray menu links.
  18. * - remainder: Any non-tray, non-tab elements left to be rendered.
  19. *
  20. * @see template_preprocess_toolbar()
  21. */
  22. #}
  23. {% set fixed_logo_attributes = create_attribute() %}
  24. <div{{attributes.addClass('toolbar','seeds_toolbar')}}>
  25. <span class="mobile-indicator"></span>
  26. <div class="seeds-toolbar-background"></div>
  27. <div class="fixed-toolbar">
  28. <nav{{toolbar_attributes.addclass('toolbar-bar','clearfix')}}>
  29. <h2 class="visually-hidden">{{ toolbar_heading }}</h2>
  30. {% for key, tab in tabs %}
  31. {% set tray = trays[key] %}
  32. {% set tray_class = tray.label | split(' ')[1] %}
  33. <div{{tab.attributes.addClass('toolbar-tab',tray_class)}}>
  34. {{ tab.link }}
  35. {% spaceless %}
  36. <div{{tray.attributes}}>
  37. {% if tray.label %}
  38. <nav class="toolbar-lining clearfix" role="navigation" aria-label="{{ tray.label }}">
  39. <h3 class="toolbar-tray-name visually-hidden">{{ tray.label }}</h3>
  40. {% else %}
  41. <nav class="toolbar-lining clearfix" role="navigation">
  42. {% endif %}
  43. {{ tray.links }}
  44. </nav>
  45. </div>
  46. {% endspaceless %}
  47. </div>
  48. {% endfor %}
  49. </nav>
  50. {{ remainder }}
  51. </div>
  52. </div>