Missing panel image custom fields

In WordPress I use Advanced Custom Fields. It contains a ton of field types. I think Kirby should too.

One example of a missing field type is an image selector that when clicking on an image in the selector stores the filename. That way it will be like a featured image. It could probably be done with just JS.

For the moment, you might want to check out this plugin (if you haven’t already): Visual file select panel field extension

@distantnative I have not seen that plugin before. Thanks!

When I Googled I found this one:

However, I think this field type should be built in. It’s that common need. I hope that @bastianallgeier is not afraid to step on some plugin developers feet by developing an own built in solution, in time.

While it’s not a visual picker, you can quickly build your own with the select field type:

fields:
  featured_image:
    label: Featured Image
    type: select
    options: query
    query:
      fetch: images
      value: {{filename}}
      text: {{title}}

This will fetch all the images attached to the page and create a select menu, saving the filename as the value and the image’s title (filename without the extension— or title field, if you’ve defined file fields in your blueprint) as the option’s user-facing text.

Nice! At last it’s built in and will probably not break. To make thumbnail preview work in the select, it needs to change to chosen or select2 jquery plugin.

Anyway this us what i probably will use for now. Thanks!

I don’t think so. Yes, it’s a common need, but including every common need in the core creates quite some bloat. Since there is a plugin architecture and these common use-cases are mostly covered by plugins right now, it’s very simple to include the plugins you need.
There is the great overview site Kirby Plugins by @DieserJonas with a collection of quite some plugins to check out.

I fully agree that it might not be good to include every common need.

When I think about it. What type of sites would need an image picker field type?..

  • Blogs
  • E-commerce / web shops
  • Showcase / Portfolio
  • Regular website

…and which type of sites doesn’t?

  • Plain text sites, like wikis (could have images as well)
  • Communities / Forums (could have images as well)

What would probably be used the most?

Image picker field or checkboxes?
Image picker field or user?

I still think image picker field.

After trying out Kirby alot for my site I’ve changed my mind about this. I don’t longer think an image picker needs to be built in. There are plugins for it and I don’t have a need for it and now I’m going to tell you why…

In WordPress

I’m a WordPress user. In WordPress you upload your image and then you attach it as a thumbnail or as a custom image (Advanced Custom Fields). In the template you get the image by the field key and get that attached image.

In Kirby

In Kirby I don’t work like that anymore. I upload my image and the filename tells me what it is. example-hero.png might be a big top image and example-thumb.png might be an archive image. It’s already correct by design, no need to attach it to a field.

In WordPress it’s not even possible to rename the images you upload without a plugin.

It’s finally going to be built in! :smiley: It worked well having it as a plugin, but I think it’s a function that belongs to the core so for me it’s very welcome.

I know I changed my mind about it a little bit, but that was mostly because I managed to work around the problem.