By hello12345 on
Hey guys,
Is it possible to disable the parent nice menu link? For example, when you hover over the menu, I only want the menus that drop down to be linked somewhere....I don't want people to click on the top menu item....
I understand you can set it to , but i don't even want that. I want it to link to nowhere.
Thanks
Comments
i meant to say i understand
i meant to say i understand you can set it to
<front>but i don't want to do thatJavascript
There's a javascript solution that basically makes the link so it doesn't go anywhere.
Put this in your template.php file (replacing pushbutton with your theme name)
For the URL path use < none> (without the space)
You could play around with the return value to get it to do other things too, but this works pretty well for flyout menus. Someone else deserves credit for this, it's on one of the nice menus pages somewhere.
Hi,Does this code make all
Thanks!
BradleyT, I just tried this
BradleyT,
I just tried this with Drupal 6 and I received the following error when I tried to enter < none> as path.
The path '< none>' is either invalid or you do not have access to it.
subscribed
subscribed
Drupal 6
Does the fix provided still work in Drupal 6?
bump
Looking to disable links for top menu items as well. Updates on this?
I use this module to create a
I use this module to create a dummy menu item http://drupal.org/project/special_menu_items try them, its cleaner than using custom code in template.php
--------------------------------------------------------------------------------------------------------
if you can use drupal why use others?
VicTheme.com
Only problem is that module
Only problem is that module is for Drupal 6 only.
or you can do it jQuery way
or you can do it jQuery way :
--------------------------------------------------------------------------------------------------------
if you can use drupal why use others?
VicTheme.com
I guess it might be possible
I guess it might be possible to do this with CSS. Specifically each menu item that needs to be disabled has an id or class. CSS rules can be used to disable the hyperlinks to the particular menu using the rules:
{
pointer-events: none;
cursor: default;
}
Try special menu items
http://drupal.org/project/special_menu_items
Allows you to set the path to and other nifty features for setting menu items when are not really menu links.
Yup, special_menu_items works
Yup, special_menu_items works great. The project page indicates that D8 may address the menu link issue natively but for now this seems to be a good solution. (Though you still will likely need to play with CSS to pretty up the menu items).