Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drupal 7 adding custom menus to pages

I have been developing with Drupal 7 for the past 4 months now, and I can't seem to find a straight answer as to how to add more menus on my pages. I understand the whole system_main_menu and system_secondary_menu, but how in the world can I add more menus to my page if I make a custom menu, let's say I have a footer_social_menu? I just love dynamic menus.

Here's what I am working with right now

function cornmaze_links($variables){
    $html = '<ul>';
foreach($variables['links'] as $link){
    $html .= '<li>'. l($link['title'], $link['href'], $link).'</li>';
}
    $html .= '</ul>';
    return $html;

}

I tried using the THEME_links($vars) function, but that affects ALL of the menus, what if I wanted to add a certain ID to a custom menu? or change the custom menu to use all divs? That's what I don't get. I can't necessarily loop through the menus using the THEME_links() function?

I don't want to put them in a block either, if I don't have to, just to avoid any extra markup that I don't need. I just want to be able to control menus, whether they be system or custom.

Any help, or light shed would be awesome! Thank you in advance!

like image 561
Aaron Olin Avatar asked Jun 08 '26 01:06

Aaron Olin


1 Answers

Try menu block module. It creates your menus as blocks and highly configurable.

Here's the documentation link.

like image 70
Muhammad Reda Avatar answered Jun 10 '26 18:06

Muhammad Reda