Drupal offer good menu management which allow you to create menu, sub menu with easier and add on menu area or block as you like. The problem is you can’t add attribute to the menu on default menu modules. You can set menu to open new windows (target=”_blank”), add class, id, rel, title, and another attribute. Instead editing the theme, there is an easier way to add attribute function when add or edit menu in drupal menu.
You can add attribute in drupal menu by adding Menu attributes modules. This modules has great feature to add attribute in drupal menu like id, name, class, style, rel, and target (open new window, open in same window, etc)
- Install Menu attributes modules on your drupal site. Go to Modules > Install New Module and choose install from modules website or upload file. Please remember to choose .tar.gz format.
- Active the modules. It requires Menu modules which is enable by default
- Go to the Structure > Menu You can add link or edit exiting link on choosen menu.
- Scroll down on add or edit menu and you will find Menu Attribute item which has more options for menu. You can set any attribute as you like and leave blank the other
- Save your link and take a look on your site.
It’s very simple, isn’t?