I am trying to make the topmenu root category not clickable using this method


but it doesn't seem to work. Anybody as a solution for this I've been looking for the past 5 hours.

  • Hello @Gabriel, Did my solution worked for you ? Or you need any help ? – Pawan Sep 24 '18 at 3:44
  • Did you get a chance to look at my answer ? – Pawan Oct 7 '18 at 6:38

The reference link you added in question is working fine and disabling click on top level category. However if above solution not worked for you alternatively you can achieve this by using jQuery.

You can use:

require(['jquery', 'jquery/ui'], function($){
  jQuery(document).ready( function() {
    jQuery("a.level-top").prop("href", "javascript:void(0)");

Above code will replace all top level href to javascript:void(0)

  • It's Working.....! – Devidas Nov 5 at 9:59
  • glad to know :) – Pawan Nov 5 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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