- Issue created by @gregory_visible
- π«π·France pdureau Paris
Hi Gregory,
Do you use UI Patterns ? You need to install
ui_icons_patterns
sub-module.In a SDC component, if you have a prop schema like this:
type: object properties: pack_id: "$ref": "ui-patterns://identifier" icon_id: type: string settings: type: object required: ['pack_id', 'icon_id']
Or, more simply, like this:
"$ref": "ui-patterns://icon"
Your prop will be recognize as an icon and managed by UI Icon (with the icon picker).
Then, inside the Twig template, you can use the Drupal Core's
icon()
Twig function with this mapping's values.Is it clear?
- π§πͺBelgium gregory_visible LiΓ¨ge
Merci , C'est bien clair.
The selection widget is now availlable.
But i'm having an error on saving ( both with field ui ans Layout builder )With layout builder the field widget disapears and there is an waring logged in watchdog :
Warning : Undefined array key "#prefix" dans Drupal\ui_icons\Element\IconAutocomplete::buildAjaxCallback() (/app/public_html/modules/contrib/ui_icons/src/Element/IconAutocomplete.php ligne 161)
With field ui ,same warning is logged and the error displayed is
An exception has been thrown during the rendering of a template (""pack_id" is an invalid render array key. Value should be an array but got a string.").
Should i open an issue with this ?