Skip to content

Tag field options : no more icons ? #7673

@Daandelange

Description

@Daandelange

Description

In Kirby 3 we were able to provide icons to the tags-field options.
This doesn't work in Kirby5 anymore.

Looking at the issue :

  • In Vue: k-tag-input needs an image prop for setting the icon while the icon prop is provided.
  • In PHP: Kirby\Options\Options::factory is only accepting icon and stripping image from options.

Meanwhile, icons on tags is not documented, the feature still seems to be available, but bugged.

Expected behavior
I expect the tags to appear. (see screenshot below)

Screenshots

Image

To reproduce

Paste this field in a blueprint:

buggytags:
  type: tags
  label: Tags
  accept: options
  options:
    - value: sun
      text: Sun
      icon: sun
    - value: wand
      text: Wand
      icon: wand
    - value: star
      text: Star
      icon: star

Observe:

Image

Optionally: Select the vue k-tags-input in the Vue2 devtools and run this in the js console to make the tags appear :
$vm0.options = $vm0.options.map(function(opt){ opt.image ={type: 'icon', icon: opt.icon}; return opt});

Your setup

Kirby Version : 5.14 (latest)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions