I have the next structure for my site:
I’m trying to create a field in the parent page (Page) that shows all the files used across every sub-subpage. Something like a general assets section.
How should the ‘query’ for this be?
page.children.find('subsubpage').images without success
Note that a files field doesn’t show all images, but lets you select from these images.
Thanks! Would it be possible to show all images if using a section instead?
I’m trying to show all the images used on the subpages but can’t seem to make it work like this.
This is placed in the site.yml
empty: No assets yet
A files section can only have a parent page, so a query won’t have any effect.
If you just want to display those files without adding them, then you can try @texnixe’s filesdisplay section plugin:
Thanks. This gets closer. But I would actually need to upload files.
My idea is to have a place where the user can add all the files at once. And then use them across the pages.
Well, if files belong to different subpages, then Kirby wouldn’t know where to add them
Maybe it would make more sense if you use the parent pages to upload the files into one place, and then use a files field to select files from this “central files repo”?
Thanks for the assist on that.
That’s actually what I want to do – and managed to do.
But the issue comes with the client populating all the subpages already with images; and being in need of showing all the the images they used i the “central files repo”. Now they are ‘lost’ and not appearing anywhere.