You are here

uikit-breadcrumb.html.twig in UIkit Components 8.3

Default theme implementation for a UIkit Breadcrumb.

Available variables:

  • items: Breadcrumb trail items. Each item contains:

    • url (optional): The URL for the item.
    • text: The text to display for the item.
    • item_attributes: HTML attributes to apply to the item.
  • attributes: HTML attributes to apply to the breadcrumb wrapper.

File

templates/components/uikit-breadcrumb.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for a UIkit Breadcrumb.
  5. *
  6. * Available variables:
  7. * - items: Breadcrumb trail items. Each item contains:
  8. * - url (optional): The URL for the item.
  9. * - text: The text to display for the item.
  10. * - item_attributes: HTML attributes to apply to the item.
  11. * - attributes: HTML attributes to apply to the breadcrumb wrapper.
  12. *
  13. * @see \Drupal\uikit_components\Element\UIkitBreadcrumb
  14. * @see template_preprocess_uikit_breadcrumb()
  15. * @see https://getuikit.com/docs/breadcrumb
  16. *
  17. * @ingroup uikit_components_theme_render
  18. */
  19. #}
  20. {%- if items -%}
  21. <nav role="navigation" aria-labelledby="uikit-components-breadcrumb">
  22. <h2 id="uikit-components-breadcrumb" class="visually-hidden">{{ 'Breadcrumb'|t }}</h2>
  23. <ul{{ attributes }}>
  24. {%- for item in items -%}
  25. <li{{ item.attributes }}>
  26. {% if item.url %}
  27. <a href="{{ item.url }}">{{ item.text }}</a>
  28. {% else %}
  29. <span>{{ item.text }}</span>
  30. {% endif %}
  31. </li>
  32. {%- endfor -%}
  33. </ul>
  34. </nav>
  35. {%- endif -%}

Related topics