I’m trying to do the same thing as I see in the docs right here: https://getkirby.com/docs/reference/panel/sections/files#filtering-files__query
So basically I want to have a files section, that uses a query to display files with varying templates, but still with a template set for uploads.
In the linked docs example the uploads
option is used to set the template together with a query
just like what I want to do. I can’t get that to work. When uploading a file it doesn’t get assigned a template. (If I instead set the template
option it will also filter the query by that template, which is not desired in this case.)
I see that the uploads
prop is not in the properties list. Can someone verify if this is supposed to work or no? Perhaps the docs example is a mix-up with the files field (which does have the uploads
option)? Either way, I think this is a needed feature since queries was introduced in 4.0. It would also align the setup of the files section and files field.
pageImages:
label: "All uploaded images"
help: The table above shows both **used** *and* **unused** images
type: files
query: page.images # just an example
uploads: image # This does not get applied on uploads
# template: image # <-- `template` also filters the list which I do not want
empty: Add some images
search: true
layout: table
rawvalues: true
image:
back: pattern
cover: false
columns:
title:
label: Filename
alt: true
photographer: true
crop:
label: Crop/focus
value: "{{ file.panelImgInfo(false) }}"
orientation:
label: Format
align: right
value: "{{ file.orientation }}"
dimensions:
align: right
value: "{{ file.dimensions }}"
size:
align: right
value: "{{ file.niceSize }}"
unusedImages:
# another similiar section here querying a custom page method