- Issue created by @mherchel
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Thanks for raising this β and looks very cool!
How do you imagine this would work? Which SDC props should accept this?
- Is it an existing shape (
type
+format
β¦)? - Is it a new one? The icon equivalent of
$ref: json-schema-definitions://experience_builder.module/image
?
- Is it an existing shape (
- πΊπΈUnited States mherchel Gainesville, FL, US
How do you imagine this would work? Which SDC props should accept this?
I would assume that it would be the latter (icon equivalent of $ref: json-schema-definitions://experience_builder.module/image).
This would then provide a form element similar to the gif in the issue summary. This would then (I think) return a SVG which could then be inserted into an icon component.
Does that make sense? I'm not too particular on the implementation. There might be lots of gotchas, but I would like to make sure the editorial experience is great (with the dedicated icon picker), and that the DX is great by allowing an easy way to specify the icon widget from within the SDC's
component.yml
file. - π«π·France mogtofu33
The Icon API β provide a render element and a Twig function based on the icon id, so the form element can simply return the icon id (
pack_id:icon_id
).For the available icons, need to create an icon pack discovery yaml (see doc β ). One file can reference all available icons through different paths.
For some starting point you can check ui_icons FormElement and derived picker FormElement.
This form element is a bit complex because of the feature to be able to set custom settings to the icon (size, color, ...) perhaps you don't need that. - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
I would assume that it would be the latter (icon equivalent of $ref: json-schema-definitions://experience_builder.module/image).
That works!
@lauriii β how high on the priority list is this?
- πͺπΈSpain gxleano CΓ‘ceres
The Iconify Icons β module already includes a submodule, the Iconify Icons Provider, which is fully integrated with the new Icon API. It provides a wide range of icon sets, making it a great opportunity to offer similar flexibility to XB users.
- π«π·France pdureau Paris
Nice to see so much great people here (David, Jean, Mike, Wim).
It would be nice to add a Icon API Form Element into Drupal Core. We didn't do it last December, in order to iterate in contrib space first. But it may be relevant now.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
I know now that it's definitely not considered a stable (
1.0
blocker).@pdureau When you said "form element", did you mean field type + field widget?