The current slot structure is not good enough:
fields:
images:
type: render
label: Images
description: "A flat list of renderable images."
preview:
- theme: image
uri: assets/image-1.png
- theme: image
uri: assets/image-2.jpg
- theme: image
uri: assets/image-3.jpg
- theme: image
uri: assets/image-2.jpg
- theme: image
uri: assets/image-1.png
- theme: image
uri: assets/image-3.jpg
labels:
type: render
label: Labels
description: "A label per image. Can be empty if image as no label."
preview:
- "Portrait blue"
- "Landscape yellow"
- "Landscape turquoise"
- "Landscape yellow"
- "Portrait blue"
- "Landscape turquoise"
Because we manipulate the 2 slots in the same loop:
{% for image in images %}
....
{% set index = loop.index0 %}
{% if labels[index] %}
....
{% endif %}
</li>
{% endfor %}
Split image_list between image_list and image_list_item
We may need a mansory variant also in image_list_item
Beware of pattern-image-list--variant-masonry.html.twig
Yes, this change is breaking. But we are still in alpha.
Needs work
2.0
Code