Remove hyperlink of top navigation element

Is there way to remove the hyperlink of top level navigation element (Demo — English) and leaving the sub items (A Page — English) intact.

You can see the type of behavior I am trying to achieve in https://plone.org 'More' navigation element.

image

You could do something like this

$(document).ready(function () {

  $(".plone-navbar-nav > li.has_subtree > a").bind("click", function (event) {
    event.preventDefault();
    $(this).siblings('input').toggleClass("active");
  });

  $(".plone-navbar-nav > li.has_subtree > label").bind("click", function (event) {
    event.preventDefault();
    $(this).siblings('input').toggleClass("active");
  });

});

It doesn't remove the link but toggles the dropdown instead.

2 Likes

Brilliant, very clever! Thanks @agitator