6

One of my menu items I have, I want to make it so that only the child links are clickable, and the parent is not. Is there a way to make the parent a sort of "Dummy Link" just to set a hierarchy for a menu?

3 Answers 3

7

The Special Menu Items module will do exactly that for you:

Special menu items is a Drupal module that provides placeholder and separator menu items.

A placeholder is a menu item which is not a link. It is useful with dynamic drop down menus where we want to have a parent menu item which is not linking to a page but just acting as a parent grouping some menu items below it.

1
  • That's exactly what I'm looking for. I'll set as answer as soon as the 10 minutes are up. Commented Mar 6, 2012 at 17:30
1

If you don't want to use another module:

In your custom module you could implement hook_menu_alter() (Or if you created the menu using hook_menu(), you could use this same approach there). You could probably make the parent item a MENU_CALLBACK that does nothing e.g. it could return TRUE or something like that.

1

http://drupal.org/project/menu_firstchild Also provides similar functionality with the exception that the main link s given the link of the first child so that you preserve usability.

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.