Skip to main content
added 169 characters in body
Source Link
dxc
  • 2.7k
  • 2
  • 17
  • 17

As far as I know you can't disable links in that way. Depending on what you want to do I believe your options are either to add a class, programmatically or by using the Menu attributes module, and then use jQuery to disable the link, or not linking the menu item at all.

First option
Add a class or an id to the link, and do something like this to disable the link:

$('#linkid').click(function(e) {
  e.preventDefault();
});

Second option
Use the Special menu items module with the <nolink> option, which results in a menu item that is not linked, i.e. no <a> tag. You could of course do this programmatically as well, but the module is rather simple and straight forward.

Hope that pointsThis is more general solutions for menu items, which I realize it's not exactly what you in the right directionare asking (a solution to your code), but it does provides solutions for your question "Can I disable module menu items?".

As far as I know you can't disable links in that way. Depending on what you want to do I believe your options are either to add a class, programmatically or by using the Menu attributes module, and then use jQuery to disable the link, or not linking the menu item at all.

First option
Add a class or an id to the link, and do something like this to disable the link:

$('#linkid').click(function(e) {
  e.preventDefault();
});

Second option
Use the Special menu items module with the <nolink> option, which results in a menu item that is not linked, i.e. no <a> tag. You could of course do this programmatically as well, but the module is rather simple and straight forward.

Hope that points you in the right direction.

As far as I know you can't disable links in that way. Depending on what you want to do I believe your options are either to add a class, programmatically or by using the Menu attributes module, and then use jQuery to disable the link, or not linking the menu item at all.

First option
Add a class or an id to the link, and do something like this to disable the link:

$('#linkid').click(function(e) {
  e.preventDefault();
});

Second option
Use the Special menu items module with the <nolink> option, which results in a menu item that is not linked, i.e. no <a> tag. You could of course do this programmatically as well, but the module is rather simple and straight forward.

This is more general solutions for menu items, which I realize it's not exactly what you are asking (a solution to your code), but it does provides solutions for your question "Can I disable module menu items?".

Source Link
dxc
  • 2.7k
  • 2
  • 17
  • 17

As far as I know you can't disable links in that way. Depending on what you want to do I believe your options are either to add a class, programmatically or by using the Menu attributes module, and then use jQuery to disable the link, or not linking the menu item at all.

First option
Add a class or an id to the link, and do something like this to disable the link:

$('#linkid').click(function(e) {
  e.preventDefault();
});

Second option
Use the Special menu items module with the <nolink> option, which results in a menu item that is not linked, i.e. no <a> tag. You could of course do this programmatically as well, but the module is rather simple and straight forward.

Hope that points you in the right direction.