1

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.

Code

{% 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 }}">
    </div>
{% endfor %}

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

1

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?

1

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.