So this may be a stupid question, but I've sort of never wrapped my head around it. When fetching an image from an entry -- even if there's only one associated with the field -- you can't just do:
{% set image = entry.image %}
You have to say:
{% set image = entry.image.first() %}
Which implies that the returned data are an object or array, and that the actual desired image is the "first" item in it. My questions are:
- Why is it structured this way?
- Which other properties are in the
entry.image
apart from the actual resource itself? What would you use those for?
I realize this may be obvious to pro Craft developers, but I remember the first Craft site I ever built, I had a devil of a time trying to remember that!