You are here

field--juicebox-relative-width.html.twig in Juicebox HTML5 Responsive Image Galleries 8.3

Same filename and directory in other branches
  1. 8.2 templates/field--juicebox-relative-width.html.twig

Theme implementation for a field that contains a relative-width Juicebox gallery.

Available variables:

  • attributes: HTML attributes for the containing element.
  • label_hidden: Whether to show the field label or not.
  • title_attributes: HTML attributes for the title.
  • label: The label for the field.
  • multiple: TRUE if a field can contain multiple items.
  • items: List of all the field items. Each item contains:
    • attributes: List of HTML attributes for each item.
    • content: The field item's content.
  • entity_type: The entity type to which the field belongs.
  • field_name: The name of the field.
  • field_type: The type of the field.
  • label_display: The display settings for the label.

File

templates/field--juicebox-relative-width.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Theme implementation for a field that contains a relative-width Juicebox
  5. * gallery.
  6. *
  7. * Available variables:
  8. * - attributes: HTML attributes for the containing element.
  9. * - label_hidden: Whether to show the field label or not.
  10. * - title_attributes: HTML attributes for the title.
  11. * - label: The label for the field.
  12. * - multiple: TRUE if a field can contain multiple items.
  13. * - items: List of all the field items. Each item contains:
  14. * - attributes: List of HTML attributes for each item.
  15. * - content: The field item's content.
  16. * - entity_type: The entity type to which the field belongs.
  17. * - field_name: The name of the field.
  18. * - field_type: The type of the field.
  19. * - label_display: The display settings for the label.
  20. *
  21. * @see juicebox_theme_suggestions_field_alter()
  22. *
  23. * @ingroup themeable
  24. */
  25. #}
  26. {% if label_hidden %}
  27. {% for item in items %}
  28. <div{{ attributes }}>{{ item.content }}</div>
  29. {% endfor %}
  30. {% else %}
  31. <div{{ attributes }}>
  32. <div{{ title_attributes }}>{{ label }}</div>
  33. {% for item in items %}
  34. <div{{ item.attributes }}>{{ item.content }}</div>
  35. {% endfor %}
  36. </div>
  37. {% endif %}