Multiple files storages - select on files field

Hello everyone!

quick question: i want to add the option to have multiple file storages. aka having a page template where the editor can have multiple ā€˜storagesā€™ for different occasions: branding, headerimages etc.

is there a way to add to the files field a select option, from where the files should be fetched from?

thanks!

Yes, itā€™s called query, see docs: Files | Kirby CMS

I am aware of the query. that one only works if you know exactly which page or files section to query. right?

but in my case, i will have multile file storages (pages) with their own file sections. so i would need a way to add a selection to the files field, where the editor can choose which file section they want to query.

i hope i explained my issue well enough :sweat_smile:

If I understand correctly my guess is you want different files sections with templates.

yes! so that at the end, there is a more advanced filesystem. multiple ā€˜foldersā€™ (pages) that hold files, and in the blocks or whereever, you can choose which of these ā€˜foldersā€™ you want to query

Can you post your current blueprint for ā€œDateiablageā€?

yes of course, its very simple:

# used as site-wide files storage

title: Sitewide File Storage
icon: image

options:
  status: unlisted

sections:
  files:
    extends: sections/files
    sortBy: name
    search: true

I read your initial post again and Iā€™m not sure what your goal is, but you can create multiple files section with different file templates and filter them in your site and page templates.

The files wonā€™t go in different folders, but the template is written in the corresponding .txt file.

This will result in different file sections in the blueprint, so you might label them accordingly.

sections:

  files1:
    extends: sections/files
    label: Branding
    sortBy: name
    search: true
    template: branding

  files2:
    extends: sections/files
    label: Headerimages
    sortBy: name
    search: true
    template: headerimage