HTML break tag in menu link

Created on 7 October 2019, about 5 years ago
Updated 17 March 2024, 8 months ago

Is there a way to use the <br> tag in a menu title? Currently it just prints out the <br> tag.

Thank you.

Feature request
Status

Active

Version

1.0

Component

User interface

Created by

🇨🇦Canada avo webworks Ottawa, Ontario, Canada

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇧🇪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 %}

Production build 0.71.5 2024