Image query on pages field

In a pages field I am trying to show the first image of the parent of the selected page, like this:

    type: pages
    query: site.find('works').index.template('edition')
    text: "{{ page.title }} | {{ page.parent.title }}"
      query: page.parent.image

But, although {{ page.parent.title }} works, page.parent.image on the image query, does not… I still see the icon both in the modal and in the list.

I was following this example from the pages docs, image query section, which is almost identical:

  query: page.children.first.image

Shouldn’t this work? What am I doing wrong ?


Ah. I see one particularity that is probably causing this… which is that parent’s images are not stored in the parent’s folder, but in a general folder… and uploaded and selected using a files field.

So hmm… I guess I have to read the first selected file from the files field

This worked.

query: page.parent.selectedimages.toFiles.first

I always find the culprit rrright after posting :smiley: