Use Iconpicker on custom configuration block form

Created on 13 December 2023, 7 months ago
Updated 15 December 2023, 7 months ago

Problem/Motivation

I want to use the font icon picker field on a custom form

Proposed resolution

Remaining tasks

Create the form, create the field, used "font_iconpicker" as type but is not working

$form['icon_picker'] = [
        '#type' => 'font_iconpicker',
        '#title' => $this->t('Icono'),
        '#description' => $this->t('Icon'),
        '#default_value' => $config['icon_picker'] ? : '',
    ];

It's my first time trying to reproduce a field provided by a contrib module to a custom form and maybe it is really simple, if you can please, provide some light, that will be great.

I read about field and widget importing but it was on D7 hooks and didn't use them,

Thanks in advance,

πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain mpereztejeiro

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

Comments & Activities

  • Issue created by @mpereztejeiro
  • Status changed to Needs work 7 months ago
  • πŸ‡«πŸ‡·France S3b0uN3t Nantes

    Hello,

    The module does not currently allow the "IconPicker" field to be used as a simple form element. It is dependent on Field UI.

    However, it is possible to consider its implementation.
    If you have the skills, don't hesitate to submit a Merge Request, otherwise, I will try to find the time to set it up soon.

  • Assigned to S3b0uN3t
  • Status changed to Fixed 7 months ago
  • πŸ‡«πŸ‡·France S3b0uN3t Nantes

    Hello,

    I have just created a 1.1.0 release which implements a "font_iconpicker" form element.
    It is now possible to use this widget in custom forms.

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

Production build 0.69.0 2024