I have a TB megamenu (8.x-1.x-dev) with a few top-level (parent) items that are not links, they should just trigger the submenu to drop down.

According to the documentation I could find, links marked as <nolink> or route:nolink will be rendered as <span> rather than <a> so styling can be retained, but they can't clicked, and submenus should still be toggled.

However, both <nolink> and route:nolink are still rendered as <a>, causing a page refresh when clicked.

I have tried adding the nolink definition as a special menu item under (A) admin/structure/menu/manage/main-menu, and in (B) the tb mega menu settings at admin/structure/tb-megamenu/main-menu, but nothing helps:

  • When adding `nolink` to the Drupal menu link (A), it leaves the link empty, but you get the page refresh when you click it. Submenu does unfold.
  • When adding `nolink` to the TB Megamenu link (B), it leaves the link empty, no page refresh as it now activates a css class that says `.nolink {pointer-events:none;}`, but button goes dead, and submenu does NOT unfold.

When on mobile, all menu items with children do unfold the submenu, don't trigger a page refresh; it's that behaviour I'd love to be able to have in desktop/laptop view too. (Even better if there is a switch "active link yes/no" or similar, so I can decide per button?)

Any help much appreciated :)

  • If you're using the dev version of a module and the issue is specific to the module, you should post in the module's issue queue, not here. Particularly if what you have found may be a bug with the module. Commented Nov 14, 2020 at 14:26
  • Hi Patrick, I did (drupal.org/project/tb_megamenu/issues/3181543) but no answer (yet) - so based on previous very good experience here and a bit of hurry to get this working on a project that needs to go live, I decided to post here as well 😌
    – xax
    Commented Nov 14, 2020 at 14:33
  • I’m voting to close this question because it's a bug report or support request to a third-party dependency hosted on drupal.org or elsewhere and must be submitted to the mentioned module's issue queue to keep fixes at a central place and not here on Drupal Answers.
    – leymannx
    Commented Nov 14, 2020 at 19:29

1 Answer 1


How are you getting those to save?

It should be route:<nolink>. Test that it works on a regular menu before trying the additional module to avoid confusion about what might be happening.

  • Yes, I tried route:<nolink> as well as <nolink> in the normal Drupal menu. That does remove the content of the <a href="foo.html" class="foo..., so you end up with <a href class="foo..., that is a blank href without any link behind it.
    – xax
    Commented Nov 15, 2020 at 22:47
  • That's not what I get with route:<nolink>, I get a span within li, no anchor.
    – prkos
    Commented Nov 16, 2020 at 1:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.