Show all images from entire website in site panel

Hello.
I have the following problem with my Kirby CMS 4 site:

I would like to have an area in the panel where all images uploaded to the site are displayed. Logically, this also includes all images that are in subfolders of “content”.

I have created a section for this in the site.yml. This should point to a blueprint file section. I get the section displayed and can also upload images via it, but only the files that are directly in the content folder are displayed.
I have tried to display all images via a query. However, it doesn’t seem to matter what I enter there, I only get the images from the content folder displayed.

Here are the different files and their contents:

/site/blueprints/sections/Images.yml

title: Bilder
icon: image
files:
  query: site.index.images
  sortable: false
  template: image

/site/blueprints/site.yml

title: Site

sections:
  pages:
    type: pages
  images:
    headline: Bilder
    type: file

It also looks as if the contents of images.yml are completely ignored. If I set the sortable to false there, for example, you can still sort the images in the panel.

Thank you very much

This doesn’t even use the section you defined in the images.yml (and there is not even a section of type file. Should be

sections:
  pages:
    type: pages
  images: sections/images

As an alternative to having a section in site.yml, you could create a separate Panel area, example GitHub - texnixe/files-area

Okay I understand. I adjusted my code, and now I get an error in the panel called “Invalid section type (“images”)”.

The name “images” comes from this part here:
images: sections/images

That’s because your images.yml file is missing a section type definition and the query is in the wrong place as well, should look like this:

title: Bilder
type: files
query: site.index.images
sortable: false
template: image

Okay, now there is an images section again. I can also upload files (and they are stores directly in the content folder), but it just says “No Files” (In german “Keine Dateien” but im not sure if the english translation of that key is exactly that).

Is this because of the query? I found that one in another post from you here in the forum.

Even after uploading new ones you don’t see any files in that section?

Yes, even the new ones dont appear there.

Ok, that makes sense because of the query, which does not include site images, for those you would have to change the query to:

query: site.index.images.add(site.images)

Do the other images uploaded to the site actually use the image template? Remove the template property

Thanks, that did the trick! :slight_smile: