You are here

slick-grid.html.twig in Slick Carousel 8.2

Same filename and directory in other branches
  1. 8 templates/slick-grid.html.twig

Default theme implementation for the slick-grid items template.

Available variables:

  • attributes: An array of attributes to apply to the element.
  • items: A renderable array containing chunks of slick-slide.html.twig.
  • settings: A renderable array containing the given settings.

File

templates/slick-grid.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for the slick-grid items template.
  5. *
  6. * Available variables:
  7. * - attributes: An array of attributes to apply to the element.
  8. * - items: A renderable array containing chunks of slick-slide.html.twig.
  9. * - settings: A renderable array containing the given settings.
  10. */
  11. #}
  12. {%
  13. set classes = [
  14. settings.unslick ? 'slick__grid' : 'slide__content',
  15. 'block-columngrid',
  16. 'block-' ~ grid_id,
  17. settings.grid_small ? 'small-block-' ~ grid_id ~ '-' ~ settings.grid_small,
  18. settings.grid_medium ? 'medium-block-' ~ grid_id ~ '-' ~ settings.grid_medium,
  19. settings.grid ? 'large-block-' ~ grid_id ~ '-' ~ settings.grid
  20. ]
  21. %}
  22. {%
  23. set item_classes = [
  24. not settings.unslick ? 'slide__grid',
  25. 'grid',
  26. settings.type ? 'grid--' ~ settings.type|clean_class,
  27. settings.media_switch ? 'grid--' ~ settings.media_switch,
  28. settings.media_switch and 'box' in settings.media_switch ? 'grid--litebox',
  29. ]
  30. %}
  31. <ul{{ attributes.addClass(classes) }}>
  32. {% for delta, item in items %}
  33. <li{{ item.attributes.addClass(item_classes, 'grid--' ~ delta) }}>
  34. <div class="grid__content">
  35. {{ item.content }}
  36. </div>
  37. </li>
  38. {% endfor %}
  39. </ul>