Global Datamanager in panel interface

Hi there,

is it possible to make every used file globally available in the panel? Just like in Wordpress or Shopware.

Currently i use the following as a query for the files in my blueprints, but obviously this only returns the files i have already used in this specific context.

query: page.images

Also the following, does obviously only return the files i used in the site.yml:

query: site.images

greetings

To query all images uploaded to any page, you can use

query: site.index.images

Querying the site index is usually discouraged, though, at least on large sites.

Many Thanks!
Yeah i know, this could get messy. But for smaller sites, it is nice to have all images available, i will think about that.

So i decided to create a tab in the site.yml which acts like datamanager to have e.g a overview of all images, and maybe have the possibility to swap them or download it.

I tried to achive it like that, which is obviously not working, but is smth like this even possible?

files:
  type: files
  default: site.index.files

Is that a files section or a field? I guess a field because of the default. But defaults don’t work in site.yml because defaults are only considered when a new page is created.

I wonder if it wouldn’t make sense for your use case to put all files into a dedicated central files folder and query from there in all pages.

so i could define a folder and use the ‘uploads:’ property to store the uploaded files there and after that i should call them in a files field.
I didnt really find any documentation to create smth like this and didnt find much about how to tweak the ‘uploads:’ property to reffer to a custom folder. Do you have some tips about the syntax for this?

Hi, i still didn’t find a good solution for creating the behavior i described in my last reply, is there any instruction online to create something similar to this?

As I wrote above, create a new folder inside the content folder (e.g. files or whatever). In your files fields, set the query to query the files from that page. Same for the uploads destination: Files | Kirby CMS

If you don’t want a separate folder, you can also store all files directly in the content folder next to site.txt. That makes all images belong to the $site object.

I see, this works fine for fields, but i want to create a list of files, which i have to do with the section ‘files’ i guess. But i didn’t found out, how to create a query for the section, because the property doesn’t exist. I tried it with parent, but didn’t found out, how to use this to create a similar query.

That’s right, you cannot use a query in a section, but only a parent

filessection:
  type: files
  parent: site.find('files') # or whatever the page name you use

I see this works pretty well. I know have adjusted the uploads property in my blueprints, to make the files globally available:

uploads: 
  parent: site.find('files')

It would be perfect the file would be available in the files folder an aswell in the current page folder like it works in default.

Sadly ‘parent:’ aspects a String, so i think i can’t realise a double upload via. the blueprint.

Also I thought about not using a ‘files’ and do something like this (but sadly this only works in fields and not in the section):

filessection:
  type: files
  parent: site.index.files

If the section doesn’t need an upload, then you could use my filesdisplay section plugin:

Allows you to use a query.

Exactly what i need, thank you very much