Save images in assets (central folder)

Hi,

by default kirby saves images / files which I’ve added via panel in the folder of the specific page and not in a central place. But I would like to have a central storage like the assets/images folder. So that I can acess to all uploaded images / files in the left sidebar when I edit a page in the panel and don’t need to upload the same image several times when I want to use it in another page. How can I do that?

Thanks and Regards

You can’t do that, at least not without heavily modifying the panel core code.

If you need images in a central place, you can upload them to the site (so they would be stored directly in the root of the content folder) or to a page folder that is only used for images. The downside of this method is that images won’t be available from the sidebar but you’d have to use a select field to select images from that page.

Okay what I have to put in my blueprint file (thats correct?) to select images from a content/images folder?

If you want to select single images, you can use a simple select field.

Your blueprint would then have something like this:

fields:
  imageSelector:
    label: Image
    type: select 
    options: query
    query:
      page: images
      fetch: images
      value: '{{uri}}'
      text: '{{filename}}'

If you want to select multiple images, you would need a custom field like the

hmm one more disadvantage is now that there is a /images page accessible. Is there any plan for kirby 3 that there will be a central images / files location? I think that would be much better than saving files in the page directories, especially when you would like to use the same image in multiple pages. So you could easily select (from all uploaded images) and insert them via panel.

Unfortunately, I can’t tell you anything about Kirby 3 at this time. All information is limited to supporters. But yes, I agree, a central repository for files would be nice to have.

Instead of using an images folder, you could use the “site folder”, then you wouldn’t need an additional folder. Or you could reroute that folder so that it is not accessible as such.