Need some help with your project? Contact me

5 cool modules that will help you build awesome Menus in Drupal

I have come across 5 cool modules that helped me when dealing with Menus. They all have different purposes, but I think you should at least know them when working with menus. The order in which these come in the article does not mirror however their importance.

Taxonomy Menu

The Taxonomy Menu is a pretty cool one as it allows you to create a regular menu based on a taxonomy vocabulary. All you need to do is create an empty menu first, and then when you create the vocabulary (or edit an existing one), you can select that menu under Menu location. You will then have available your taxonomy terms as items in a menu block.
Additionally, you get all sorts of configuration options for each vocabulary, the most important ones being:

  • To synchronize changes to the vocabulary with the menu
  • To display in parentheses the number of nodes each term has been assigned to
  • To hide terms that are not assigned to anything
  • Add the description of the vocabulary and/or terms
  • And others

Superfish

Superfish is rather layout oriented I would say. It integrates into your Drupal menus the JQuery superfish plugin to create nicely designed expandable menus. To install this module you need the Libraries module and the Superfish JQuery library. Once everything is installed, you’ll be able to create Superfish blocks that will customize and stylize your menu of choice for each particular block.

In the block configuration you have a number of options and preset styles. The most important however are the Menu Parent (the menu that will use this superfish configuration) and the Menu Type: horizontal or vertical.

Then you can choose a Style, the JQuery animation speed and mouse delay as well as the Slide-in effect: vertical / horizontal / diagonal. Moreover, you have some additional plugin options and a number of advanced html and css settings. I let you explore these and play with them. And, needless to say, you can customize the styles with your own css, so go crazy!

Menu Attributes

Menu Attributes is a really handy module that allows you to target individual menu items for manipulation in css. I wrote a more comprehensive blog post on this module a while ago, but the most common use for this module is I think the possibility to add custom classes and IDs to individual menu items. But you can also specify a rel attribute, the link target, as well as an AccessKey.

Special Menu Items

Although having covered it separately in another post a while back as well, Special Menu Items is another cool Drupal module that can do something really simple but sometimes really needed. After you install it, it will seem invisible, but it will provide a very important option under any menu item: .

This means is that you can bypass the default Drupal requirement to add a valid path behind every one of your menu items and have it link to nothing. Pretty cool a? Personally, I didn’t find useful the other option you get - - but i encourage you to experiment with it if you want.

Menu Firstchild

Menu Firstchild is I think a perfect follow-up to Special Menu Items in that it provides one more option in the menu item configuration for the path: .

What this does is really simple. It links the menu item to its first child. Have you ever had expandable menus with parents that did not have pages themselves but only their children? Well with this module you can have the parent link by default to the first child.

I know what you are going to say, can’t you just give it directly the path of the first child and be done with it? You can, but if you have lots of menu items, that even change sometimes the order of their children, it is easy to make mistakes or forget something. With this, you are covered that no matter what the first child is, the parent will link to it.

Conclusion

OK, so this is it for now. I hope you find good use for these modules, I know I have.

Add new comment

You can post comments in Markdown and basic HTML tags.
For code blocks, wrap your code within '~~~'. For example:
~~~
$var = 'my variable';
~~~