You are here

uikit-description-list.html.twig in UIkit Components 8.3

Default theme implementation for a UIkit Description List.

Available variables:

  • items: An array of items to be displayed in the description list. Each item can be an associative array with the properties "term" and "description", or be a string if the definition should be displayed with the previous item's term.
  • attributes: HTML attributes to apply to the defintion list.

See also

\Drupal\uikit_components\Element\UIkitDefinitionList

template_preprocess_uikit_definition_list()

https://getuikit.com/docs/definition-list

File

templates/components/uikit-description-list.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for a UIkit Description List.
  5. *
  6. * Available variables:
  7. * - items: An array of items to be displayed in the description list. Each item
  8. * can be an associative array with the properties "term" and "description",
  9. * or be a string if the definition should be displayed with the previous
  10. * item's term.
  11. * - attributes: HTML attributes to apply to the defintion list.
  12. *
  13. * @see \Drupal\uikit_components\Element\UIkitDefinitionList
  14. * @see template_preprocess_uikit_definition_list()
  15. * @see https://getuikit.com/docs/definition-list
  16. *
  17. * @ingroup uikit_components_theme_render
  18. */
  19. #}
  20. {%- if items -%}
  21. <dl{{ attributes }}>
  22. {%- for item in items -%}
  23. {% if item is iterable %}
  24. <dt>{{ item.term }}</dt>
  25. <dd>{{ item.description }}</dd>
  26. {% else %}
  27. <dd>{{ item }}</dd>
  28. {% endif %}
  29. {%- endfor -%}
  30. </dl>
  31. {%- endif -%}

Related topics