Closed (fixed)
Project:
Font Iconpicker
Version:
1.0.5
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
13 Dec 2023 at 13:28 UTC
Updated:
29 Dec 2023 at 16:44 UTC
Jump to comment: Most recent
I want to use the font icon picker field on a custom form
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,
Comments
Comment #2
s3b0un3tHello,
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.
Comment #3
s3b0un3tHello,
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.