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.
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.