dashboard_menu_icon_name
Resolves a full icon identifier to the short form expected by the icon library, usingicon_library_prefix_map from the bundle configuration.
bootstrap-icons:house.
Output: The resolved short form, e.g. bi:house, based on the icon_library_prefix_map configuration. If the prefix is not found in the map, the input is returned unchanged.
This filter is what the built-in
menu.html.twig template uses internally before passing icon names to ux_icon(). You only need it directly when building a custom menu template.How it works
Theicon_library_prefix_map config maps verbose prefixes to the short aliases your icon library expects:
nowo_dashboard_menu.yaml
| Input | Output |
|---|---|
bootstrap-icons:house | bi:house |
bootstrap-icons:bar-chart | bi:bar-chart |
heroicons:home | heroicons:home |
unknown-lib:star | unknown-lib:star (unchanged) |