Be able to provide icons to patterns used as layouts

Created on 6 February 2023, over 2 years ago
Updated 4 March 2023, over 2 years ago

Problem/Motivation

UI improvement: To be able to provide an icon to patterns used as Layout.

Proposed resolution

Remaining tasks

User interface changes

💬 Support request
Status

Fixed

Version

1.0

Component

User interface

Created by

🇫🇷France Grimreaper France 🇫🇷

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Grimreaper
  • 🇫🇷France Grimreaper France 🇫🇷
  • 🇫🇷France duaelfr Montpellier, France

    I've been able to use the icon_map key within one pattern with UI Patterns Layout Builder.

    layout_test:
      label: Layout test
      settings:
        distribution:
          type: select
          label: Distribution
          options:
            25-75: '25 / 75 %'
            33-66: '33 / 66 %'
            50-50: '50 / 50 %'
      icon_map:
        - [title]
        - [content_main, content_secondary]
      fields:
        title:
          type: string
          label: Title
          preview: 'Preview title'
        content_main:
          type: string
          label: Main content
          preview: 'Main content'
        content_secondary:
          type: string
          label: Secondary content
          preview: 'Secondary content'
      libraries:
        - layout_test:
            css:
              component:
                layout_test.css: {}
    

    Would you want to be able to provide an icon as an image file?

  • Assigned to Grimreaper
  • Status changed to Needs review over 2 years ago
  • 🇫🇷France pdureau Paris

    Thanks @Duaelfr tested on my project, it works!

    @Grimreaper I guess this "Icon map" solution is OK, isn't it?

  • 🇫🇷France duaelfr Montpellier, France

    Seen during the monthly call: icon_path also allow to set a path to an icon file.
    It only works on Layout Builder with UI Patterns Layout Builder.

  • Issue was unassigned.
  • Status changed to Fixed over 2 years ago
  • 🇫🇷France Grimreaper France 🇫🇷

    Hi,

    Tested with:

      icon_map:
        - [ title, toto, tutu ]
        - [ title, content_main, content_secondary ]
        - [ a, b, c, d, e ]
    
      icon_path: "themes/custom/ui_suite_bootstrap/screenshot.png"
    

    Ok for me, a little bit sad that with icon_path it is not related to the pattern path or the module or theme path containing the pattern.

  • 🇫🇷France duaelfr Montpellier, France

    (I agree, let's open a followup :) )

  • 🇫🇷France pdureau Paris

    Is it possible to extend Drupal\ui_patterns\Form\PatternDisplayFormTrait to display those icons on others places?

    For example, like what is done by: https://www.drupal.org/project/select_icons

  • 🇫🇷France Grimreaper France 🇫🇷

    Follow up issue created: Be able to provide relative icon path Active

    @pdureau: I think it would also be nice, but maybe the icon size will not be adequated. I let you create a dedicated issue for this subject.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024