Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

9. Putting it Together > Beyond core menu items

Beyond core menu items

Drupal's menu structure did not get a major renovation since version 5.0. I am hoping that this will change with Drupal 8, but I am not holding my breath. Until then, we will have to put up with a witches brew of add-on menu functionality. One such module is Menu Attributes. How many times have you wanted each menu item to have a unique ID? Menu attributes solve that problem. How many times have you wanted to add extra classes to menu items? Menu Attributes solve this problem as well. What Menu Attributes does is extend the functionality of menu items to allow a series of standard markup choices to be changed on a per-menu-item basis. However, it is much better than just that.

Menu Attributes adds its own hooks, so that you can add your own attributes to menu attributes' configuration options. Consider that at the beginning of this book you probably did not know that the data-role and data-theme properties exist and as little as a year ago, they did not exist at all. This is fantastic news! We can add some of our data-* properties to Menu Attributes with a little bit of hook magic. Let's get started!


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint