Sorry for not being very clear…
The issue is, that I don’t have a specific page that I can query from.
My panel is structured in a way that the files that can be selected for file fields are all stored in one folder, to be able to make sure there are no duplicate files in various different pages. Files are being referenced on different pages, therefore my client doesn’t wanna upload the files on every page again and again, if a file needs updating.
I achieve that by adding a query to the file field and setting the uploads path:
fields:
document:
type: files
query: site.index.files.filterBy('type', 'document')
uploads:
parent: page('document-page')
Then in the Files Section
of my Panel page, which is another tab, I’m setting the parent to the same document-page as referenced above:
sections:
someFilesSectionName:
type: files
parent: page('document-page')
(I do that by the way in this complicated way because I’m still on Kirby 3 which doesn’t have the query
option for files sections yet…)
Now what I want to achieve is to display the page names in the Files Section
where each file if referenced on, to be able to give the user a nice overview over all the files like so:
For that I need to query the files that each page obviously holds. That’s kindof where the issue starts.
Currently I am taking all pages and then checking on the files that each page provides. But, as mentioned before, this only returns the files on a file system level, not the actual files belonging to the page model.
So what I was trying, which didn’t work as expected:
site()->index(true)->pluck('files')
Does that make a bit more sense, what I’m trying to achieve? Maybe it’s just not possible that easily, then I have to find some other workaround…
Thanks in advance!