Blog/ Using Menu Attributes in Drupal 7

Menu attributes allow you to specify some additional attributes for the menu item such as Title, ID, Name, Relationship, Classes, Style, Target and Access Key. 

Before Menu Attributes module, we had to dig into php code and write hooks for even adding a single class to a menu item. Now, you can add a class, target or any other property by using Drupal Administration. Since Menu Attributes module provides a UI, a non-programmer can add the additional attributes to a menu item. It allows you to control how you want do display an individual menu item and you are no more limited to make every single main menu item to look identical. By adding custom classes or IDs to each menu item, you can add icons and animations as well.

Steps to use the Menu Attributes Module:

  1. Download Menu Attributes module (drupal.org/project/menu_attributes)
  2. Install and enable the module.
  3. Navigate to "Structure-> "Menus" -> "Main Menu" > "List links"
  4. Edit any menu item

It allows you to set the following attributes:

  • Title
  • Id
  • Name
  • Relationship
  • Classes
  • Style
  • Target
  • Access key
 
Ready to get started?REQUEST A QUOTE