1

Proposed Menu description

Hi all, I want to add descriptions under my menu items like above (Eg. Home (ADD my description) Products (etc)? Do I have to create children under these menu items and enable these???? Any advice would be appreciated.

Drupal 7

1 Answer 1

5

I think you're going to need to do a little (code) preprocessing of the menu in your theme layer.

To achieve this, I would put my description text in the "Description" part of my links (which is actually the title attribute) and then add a theme_menu_link() function to template.php (https://api.drupal.org/api/drupal/includes%21menu.inc/function/theme_menu_link/7).

Most people overload this function to add attributes to the menu links (like classes or ID's) but you could also adjust it to pull out the text you have placed in the title attribute, then mark it up however you want (span, div, etc..) and then return it in the Menu Link Title.

I see that you have also tagged your question with Superfish so you may need to review the theme superfish function as well (http://api.drupalhelp.net/api/superfish/superfish.module/function/theme_superfish/7).

0

Your Answer

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

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