View all images on all pages from site.yml blueprint?

I need to go through and change metadata on all images in all posts. I’d love to be able to do this via the panel and preferably just by pressing left/right on the keyboard to cycle through them instead of diving into each page and clicking on the files there. Is this possible?
I tried:

allImages:
        type: files
        headline: All Images
        query: site.index.files  # Get all images from all pages
        info: "{{ file.dimensions }}"
        image:
          ratio: 5/4
          cover: true
        size: small

Which shows me all the files, but I guess because they’re still organized into sub-directories I can’t just navigate through them all.

Have a look at @texnixe Plugin:

This will list all files alphabetically. The display can also be restricted to images. A separate menu item will be displayed in the navigation.

EDIT: The suggestion from @lukasbestle is another approach that I have not yet tried.

Your analysis is correct. The query makes the section list all files throughout the site, however the prev/next navigation directly on the file view is not aware of the section you came from. So it does not have the same list for the navigation that the query in your section generates.

What you could do is to create a page with virtual files like so:

<?php

use Kirby\Cms\Page;
use Kirby\Cms\Files;

class ImagesPage extends Page
{
  public function files(): Files
  {
    return $this->site()->index()->files();
  }
}

Because it’s a collection on a single page, the prev/next arrows will work. However I haven’t tested this myself. It could be that editing those files won’t fully work as expected.

1 Like

Ok thank you I’ll give this a shot