2

I have an entry with an asset field that has up to 3 assets in it. If I want to load just the second asset in my template code, what's the syntax for this? (can't find any references/examples)

1

Image assets are returned in an array. Let's say you have an assets field with the handle of images. You can just use bracket notation to get the second item in the array using: entry.images[1]. So if you wanted to return the URL you could just do:

{{ entry.images[1].url }}
| improve this answer | |

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.