0

I have a main menu with links: menu1 menu2 menu3 menu4

When entering the menu1 I want to display a secondary menu with links: sub-menu1 sub-menu2 sub-menu3

and sub-menu1 to be activated as a default. Every sub-menu has to have a separate page, because in every sub-page the wallpaper will be different.

When entering the sub-menu2, there will be different content, wallpaper, the chosen sub-menu will be activated and also his parent menu, in this case menu1.

How can I do this?

  • OK, converted my comment to a bit more elaborated answer. – Mołot Jul 18 '13 at 13:35
0

Seems all you need is normal menu 2 levels deep. Use Menu Block for greater control what to display where.

Make sub-menu1 and menu1 menu elements to point to the same node to get "sub-menu1 to be activated as a default" requirement.

For a background, just add background field to your content type, simple as that.

0

you can use menu_tree to override your menu :

try this code in your template.php :

function THEMENAME_menu_tree__MACHINENAME($variables) {
$menuTree = menu_build_tree('MACHINENAME');
$output = '<ul id="nav">';
foreach ($menuTree as $item)
{
    $output .= '<li>' . $hasSub;
    if (count($item['below']) > 0)
    {
        $output .= '<ul class="sub-menu">';

        foreach ($item['below'] as $subItem)
        {
          $output .= '<li class = "'.$class.'"><a href="' . url($subItem['link']   
          ['link_path']) . '">' . $subItem['link']['link_title'] . '</a></li>';
        }
        $output .= '</ul>';
    }
    $output .= '</li>';
}
$output .= '</ul>';
return $output;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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