0

I have several menus that I want to use, and theme differently. I'm looking into different ways to theme them and it appears that the most elegant way would be to use the template.php file with menu tree. I'm not quite sure how to set different conditions for different menus in this file however.

2
  • 3
    have you investigated the drupal.org/project/menu_attributes module?
    – Jimajamma
    Commented Jan 27, 2014 at 3:09
  • "Most elegant way" makes it a candidate for "opinion based" closure. Wouldn't just opinion-neutral "how to" satisfy you?
    – Mołot
    Commented Jan 27, 2014 at 7:52

1 Answer 1

2

Menu Attributes is definitely a way to do this.

This simple module allows you to specify some additional attributes for menu items such as id, name, class, style, and rel.

You should use this module when

  • You want to "nofollow" certain menu items to sculpt the flow of PageRank through your site
  • You want to give a menu item an ID so you can easily select it using jQuery
  • You want to add additional classes or styles to a menu item

The module currently allows you to set the following attributes for each menu item:

  • Id
  • Name
  • Target
  • Rel
  • Class
  • Style
  • Accesskey

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.