getkirby / kirby

Kirby's core application folder
https://getkirby.com
Other
1.32k stars 168 forks source link

Broken preview of toggles field value inside structure field #4566

Closed foxacid closed 2 years ago

foxacid commented 2 years ago

Description

When using the new toggles fields inside a structure, the structure preview outputs only the option, not the value. In case the options are translated, nothing is output at all.

Expected behavior
It should behave like a select or toggle field, i.e. the preview outputs the (translated) value, not the option.

Screenshots

k3_structure_select

k3_structure_toggles

To reproduce

gallery:
  type: structure
  label:
    en: Gallery
    de: Galerie
  fields:
    image:
      label:
        en: Image
        de: Bild
      type: files
      multiple: false
      image:
        back: black
      uploads:
        template: blocks/image
    size:
      label:
        en: Size
        de: Größe
      type: toggles
      required: true
      options:
        xs: XS
        s: S
        m: M
        l: L
        xl: XL
      default: l
      width: 1/2
    alignment:
      label:
        en: Align
        de: Ausrichtung
      type: toggles
      required: true
      options:
        left:
          en: Left
          de: Links
        right:
          en: Right
          de: Rechts
      default: left
      width: 1/2

Kirby Version

3.7.3

afbora commented 2 years ago

foxacid commented 2 years ago

That was quick, thanks! 👍