Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I am using this template.php function:

function mytheme_menu_tree($variables) {
    return '<ul class="page_nav" id="pages">' . $variables['tree'] . '</ul>';
}

Now it applies to the menu no matter in which region it is. What if I want it to apply only if the menu is inside i.e. Top Menu region? I guess its something that needs to be added before return line?

Also I noticed another problem. It applies to all menus, i.e. if I have two menus, my return line applies to both menus, and 2nd menu is not even shown because id="" can be shown only once.

So I need that function to apply to the menu which is in Top menu region only.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

You can use theme_menu_tree__MENU_NAME() to target a specific menu.

share|improve this answer
    
Yes, but I cannot predict what menus the users will be creating and using. –  user13176 Jan 30 '13 at 17:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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