Sorry, we don't support your browser.  Install a modern browser

Select field: option groups

In some cases it would be helpful to have the possibility to use native option groups in select fields like this:

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

I know that this is certainly not a popular wish, I think this comes from the fact that it is also quite easily possible to circumvent this with some rather pointless entries, see screenshots. But is it conceivable that this basic HTML “optgroup” element will find its way into Kirby at some point? Sometimes it would really be so practical, I now have dozens of fields in Kirby with some kind of “section separators” that are purely visual in nature.

9 months ago

I’m in a situation, where optgroups in selects would improve the UX quite a bit:

label: Ort
type: select
options:
  solar: "Bahnhof: Solar"
  fahrraeder: "Bahnhof: Fahrräder"
  oberleitung: "Bahnhof: Bahnhof Oberleitung"
  gleise: "Bahnhof: Bahnhof Gleise"
  bahnsteig: "Bahnhof: Bahnsteig"
  mensch_sitzt: "Bahnhof: Mensch sitzt"
  mensch_handy_stehen: "Bahnhof: Mensch Handy stehen"
  mensch_wartet: "Bahnhof: Mensch wartet"
  mensch_rollstuhl: "Bahnhof: Mensch Rollstuhl"
  mensch_handy_gehen: "Bahnhof: Mensch Handy gehen"
  busbahnhof: "Bahnhof: Busbahnhof"
  autonomesfahren: "Bahnhof: Autonomes fahren"
  parken: "Bahnhof: Parken"

  kran_1: "Güterterminal: Kran"
  containerschiff: "Güterterminal: Containerschiff"
  anlegestelle: "Güterterminal: Anlegestelle"
  gueterzug: "Güterterminal: Güterzug"
  guetergebaeude: "Güterterminal: Gütergebäude"

  brueckenbau: "Baustelle: Brückenbau"
  kran: "Baustelle: Kran"
  gleisbau: "Baustelle: Gleisbau"
  bagger: "Baustelle: Bagger"
  baumaterial: "Baustelle: Baumaterial"
  drohne: "Baustelle: Drohne"
  baugebaeude: "Baustelle: Baugebäude"

This request does seem quite popular:

a month ago