Anyone with Neo experience had issues with outputting an assets field with multiple images? I am not using a dynamic field, as I saw there are issues with that.


{% for asset in block.serviceGallery %}
    <div class="fg-col-xs-6 fg-col-md-4" data-gallery="{{ loop.parent.index }}">
        <img src="{{ asset.getUrl('square') }}" alt="{{ asset.title }}">
{% endfor %}

Error: Key "index" for array with keys "entry, ... " does not exist.


You'll need to reference the field handle within asset.
For instance > {{ asset.imageHandle.getUrl('square') }}.
I'm guessing you aren't seeing {{ asset.title }} either?


The issue here was not to do with NEO or how to access them, it was the loop index call to the parent not getting the correct context.

{{ loop.parent.index }} was the issue. It needed to be {{ loop.parent.loop.parent.loop.index }}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.