Files field in file blueprint

Hello everyone!

I was wondering if it is possible to add a file field in a file blueprint, fetching all the images (if there is any) of the parent page.

I have to put documents on my website. Every doc has its cover.
I would like to avoid a field where the client has to select both the doc and the jpg for the cover, including this choice directly in the document blueprint (hope you understand what I mean).

Here’s my blueprint:

title: Documenti PDF

  mime: application/pdf


    label: Copertina
    type: files
    multiple: false
    # query: page.files.template('images')
    query: site.find('system').children.images.filterBy('template', 'images')
    uploads: false

Thank you for letting me know if this is even possible or if I’m just waisting my time.
Have a wonderful evening!


Should be possible, what’s the problem, the query? Try

query: file.parent.images.template('images')

Sonja you always save me!

Apparently I keep complicate things that are easy. Of course with this query it works.

Thank you so much! :heart:

1 Like