sylvainjule / kirby-imageradio

Add illustrations to Kirby's radio buttons. Kirby 3 and 4.
59 stars 6 forks source link

[Kirby 3] Default value #4

Closed medienbaecker closed 5 years ago

medienbaecker commented 6 years ago

I think a default value is missing from the Kirby 3 version. Or am I doing something wrong?

beverage:
  label: Beverage
  type: imageradio
  default: wine
  options: 
    beer:
      text: Beer
      image: beer.jpg
    wine:
      text: Wine
      image: wine.jpg
sylvainjule commented 6 years ago

The default value works for me. Try and compare with the core radio field, it should behave the same way? I'm extending it and didn't touch anything default-related.

Default in K3 works by pre-filling the .txt file on page creation. So, if you've already created a page and add the default option in the blueprint afterwards, it will not fill the field. There's no backward default-filling.

sylvainjule commented 6 years ago

Searching for an error allowed me to spot one for the default checkboxes / imageboxes field though. 🙉

sylvainjule commented 5 years ago

Both Imageradio + Imageboxes defaults should now work as their core-fields'. Don't hesitate to reopen if still experiencing an issue ☝️