Color field with API options: value not saved

Hi everyone,

I’m using a color field in my site.yml blueprint, with options coming from a custom JSON file served via the api option like this:

site_head_background:
  type: color
  options:
    type: api
    url: http:/mysite.test/assets/json/colors.json

The JSON looks like this:

{
  "#171406": "Dark",
  "#2d2816": "Dark Glare",
  "#aba9a2": "Mid",
  "#ffffff": "Light",
  "#fccd26": "Primary"
}

Here’s the issue:

  • The panel shows the color options properly
  • I can select a color in the Panel only if I clear the site.txt file manually
  • After saving, the selection doesn’t stick.

Am I missing something in how API options are expected to work with the color field?

Thanks a lot!

Mathieu

I cannot reproduce this issue. Could you please test this with a fresh Kirby 5.0.2 Starterkit?

I don’t know when it happened, given that the lines I pasted above are correct, but I had a double “:” after site_head_background :smirking_face:
Sorry about that.