- 🇧🇪Belgium hansrossel
In a custom module:
function MODULENAME_preprocess_superfish_menu_items(array &$variables) {
.... copy everything the first part of the function from superfish.theme.inc ....
$attributes = $item_attributes->__toString();
$menu_item_title = (string) $item['text'];
$menu_item_url = $item['url']->toString();
$link_element = '' . $menu_item_title . '';;
$link_element_menuparent = '' . $menu_item_title . '';;$variables['menu_items'][] = [
.... copy the last part of the function from superfish.theme.inc ....
}Copy superfish-menu-items.html.twig to your theme and add raw to the output of the menu links
{% if item.children is not empty %}
{{ item.link_menuparent|raw }}
{% else %}
{{ item.link|raw }}
{% endif %} - Status changed to Closed: won't fix
17 days ago 9:09am 23 May 2025 - 🇧🇪Belgium lobsterr
I don't think we will implement this.
1) It is a security problem
2) A default menu system doesn't support it eitherPlease you work around solutions
- 🇨🇦Canada awasson
@lobsterr, fair enough and thanks for closing the issue so that it's not just hanging.
The method I proposed using BBE like markup ( #4 ✨ HTML break tag in menu link Active ) has been useful in websites I've built for universities and associations where menu links need this type of treatment for visual context. Rather than try to mess with Superfish core, I added a custom module to override Superfish to use my tokens when rendering the menu. If I have the bandwidth, I'll release a module or I'll add to the docs so that others can work around it.
Cheers,
Andrew