Were option groups ever implemented?

Hi, there is an issue here that suggests that option groups were implemented for select fields in a blueprint:

However, there is nothing about option groups or separators in the select documentation: Select | Kirby CMS .

I have tried this approach:

        category:
           label: Category
           type: select
           options:
             - Group 1
               design: Design
               architecture: Architecture
             - Group 2
               photography: Photography
               3d: 3D
               web: Web

and this approach:

       category:
         label: Category
         type: select
         options:
           Group 1:
             design: Design
             architecture: Architecture
            Group 2:
              photography: Photography
              3d: 3D
              web: Web

But neither seem to work.

No, such a feature does not exist. The ideas repo is very old, new feature requests:

https://feedback.getkirby.com

Don’t know if there is a corresponding request.

@texnixe Okay, thanks for that! Just checking I hadn’t missed something. It looks like there’s a request here: https://feedback.getkirby.com/29. I’ve upvoted that, but in the meantime will just make the list alphabetical.

The alternative would be a custom select field, howoever, I cannot tell from the top of my head how easy or complex it would be to extend the current select field accordingly.

I’m thinking the simplest, at least in my case, is to swap to a multiselect field but restrict to one value and keep it searchable. I’m not sure if there are downsides to that - I’ll try it out :crossed_fingers:

       category:
         label: Category
         type: multiselect
         max: 1
         search: true
         options:
           design: Design
           architecture: Architecture
           photography: Photography
           3d: 3D
           web: Web
           ...long list...

I’m not sure if there are downsides to that

Well, one is that when: conditions don’t work with multiselect. I hadn’t realised that. If you have an “Other” option that you want to conditionally open a “Please specify” field, then this doesn’t work with multiselects. In my case, I’ve left the “Please specify” field visible. That’s not a problem in my current project. I’ve just added help text like “Leave blank if you selected an item above.” That might not be so good in other projects, but in this case the UX improvement of multiselect is worth it.

See Conditional fields display and multiselect.