I'm having trouble trying to output assets from an Assets field that's within a Matrix block, using Imager. The code below is only outputting the first image that has been added, over and over for each asset, rather outputting each different asset. What am I doing wrong?
I did try changing {% set logo = block.logos.first() %}
to {% set logo = block.logos.all() %}
, but that gave me an internal server error.
{% for block in entry.modules.all() %}
{% if block.type == "logosBlock" %}
{% for image in block.logos %}
<div class="logo-child">
{% set logo = block.logos.first() %}
{% set transformedImage = craft.imager.transformImage(logo, { width: 312, height: 200, }) %}
<img src="{{ transformedImage.url }}" alt="{{ logo.title }}">
</div>
{% endfor %}
</div>
{% endif %}
{% endfor %}