Add attribute to main menu item In my project I would like to add the following attributes to my "Login" main menu item:

data-toggle="modal" data-target="#login-modal" (Am using the Bootstrap theme)

I checked out the menu attribute module but it does not allow for these attributes.

Please is there a way?
You can use this HOOK_menu_link_alter and add new attribute from there.

https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_menu_link_alter/7

function MYMODULE_menu_link_alter(&amp;$item) {
  if ($item['link_path'] == 'user/login') {
    $item['options']['attributes']['data-toggle'] = 'modal';
    $item['options']['attributes']['data-target'] = '#login-modal';
  }
}


Note : Make sure you clear cache and are checking this for anonymous user.