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.twigView source
- {#
- /**
- * @file
- * 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.
- *
- * @see \Drupal\uikit_components\Element\UIkitBreadcrumb
- * @see template_preprocess_uikit_breadcrumb()
- * @see https://getuikit.com/docs/breadcrumb
- *
- * @ingroup uikit_components_theme_render
- */
- #}
- {%- if items -%}
- <nav role="navigation" aria-labelledby="uikit-components-breadcrumb">
- <h2 id="uikit-components-breadcrumb" class="visually-hidden">{{ 'Breadcrumb'|t }}</h2>
- <ul{{ attributes }}>
- {%- for item in items -%}
- <li{{ item.attributes }}>
- {% if item.url %}
- <a href="{{ item.url }}">{{ item.text }}</a>
- {% else %}
- <span>{{ item.text }}</span>
- {% endif %}
- </li>
- {%- endfor -%}
- </ul>
- </nav>
- {%- endif -%}