Thank you @texnixe for your detailed explanation on how the queries work! I’m trying to realize two separate sidebar groups for “Images” and “Documents”, but the queries don’t seem to work for me right now…
I’m extending the page preset by adding
You probably need set the mime type on the section. This will restrict that section to only accept files of that mime type (and display only files of that type). But the query should work too, what you did looks ok to me.
for example, my docs.yml that gets used by the files section looks like this:
title: Docs
accept: application/*
And my images one looks like this:
title: Image
accept: image/*
To make it work you need to set the you files section to use that template:
Oh yeah, the section template is a good idea, yet I don’t seem to grasp how to apply it to my case (had two beers just now, abstract thinking is getting harder…) especially since you also think the query should be working! Plus I don’t want to add too many templates, this specific section is not going to be reused again in my project.
On an unrelated note, I don’t know why my confused brain thought label was the proper way to give the field a headline. Thanks for clearing this up
Don’t panic, i’ve had a couple of beers too It just needs to go in the file meta you want to use for those types of files. Be aware that application/* does snag a couple of file types that you may or may not want someone to upload (like binary files). To get around that you would have to list out specifically all the mime types you do want to except. I was just lazy and used the wildcard.
I’m always baffled by how people can drink and still be able to write good code. I recently accidentally removed a whole page before going to bed and woke up to a bunch of confused mails from my client… Luckily it wasn’t a production server!
Anyhow – right now, none of your suggestions work for me (after adding the section template, no files are showing at all and I can still upload files of all mime types. I guess the problem lies somewhere else because in theory it all makes sense… I’ll go to sleep & find the solution tomorrow
It will do that, yes. Once you have added the mime type settings, it stamps the uploaded files in the content file. Its empty becuase you havent upload anything into that field yet. You have files that match already on the server, but they didnt pass through that field, so they wont show up. Confused me at first, and its a little odd, but there it is.
Not sure why it isnt respecting the mime type when you upload though, it works for me.