I cannot get drop down menus to work. In the theme settings here is what I have done so far:

Under Menu: Depth of menu to display: set to 2
Under Optional CSS: checked "Enable menus.css" (as suggested when I set the depth of the menu)

... and then in Drupal's Main menu settings, I made sure a parent menu item is "expanded".

If I view my menu with firebug, the full menu tree is not rendering (just top level items) so perhaps there is some other issue. This is on a brand new Drupal 7 clean install.

Comments

himerus’s picture

Assigned: Unassigned » himerus

Ensure that in your menu settings.... /admin/structure/menu/settings

That BOTH menus (primary and secondary) are set to the main menu you are using.

That "should" do it... can't think of any other reason it wouldn't. Let me know if it works and I can close this out.

- Jake

Danny Englander’s picture

Status: Active » Fixed

Yes, that did it. thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

TechNikh’s picture

I don't see these options in 7.x-3.0-beta3
Under Menu: Depth of menu to display: set to 2
Under Optional CSS: checked "Enable menus.css" (as suggested when I set the depth of the menu)

How to show dropdown menus in 7.x-3.0-beta3?

fubhy’s picture

Dropdown menus are not part of Omega anymore (and they shouldn't be coded into any theme imo). To add a dropdown menu to your site use one of the many modules.

TechNikh’s picture

Thanks I used nice menus for the dropdown. http://drupal.org/project/nice_menus

mrP’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev

@fubhy -- could this be added to the documentation? First, that dropdown menus are no longer coded into Omega; second, an example implementation of something like nice_menus in an Omega subtheme.

2pha’s picture

where is the Depth of menu setting?
Or does Omega not output second level menu items in the html list, even if they are expanded?

2pha’s picture

I'll put this here in case anyone finds it useful.
This is how I implemented dropdown menus for the main menu without a module.

In the process folder I added a file called 'process-region.inc' with this code.

function MYTHEME_alpha_process_region(&$vars) {
	if($vars['region'] == 'menu'){
		$menu_tree_page_data = menu_tree_page_data(variable_get('menu_main_links_source', 'main-menu'));
		$vars['main_menu_expanded'] = menu_tree_output($menu_tree_page_data);
	}
}

In the templates folder I added a file called 'region--menu.tpl.php' with this code to override the omega theme.

<div<?php print $attributes; ?>>
  <div<?php print $content_attributes; ?>>
    <?php if ($main_menu || $secondary_menu): ?>
    <nav class="navigation">
    	<?php print '<h2 class="element-invisible">Main menu</h2>';?>
    	<?php print drupal_render($main_menu_expanded);?>
      <?php print theme('links__system_secondary_menu', array('links' => $secondary_menu, 'attributes' => array('id' => 'secondary-menu', 'class' => array('links', 'inline', 'clearfix', 'secondary-menu')), 'heading' => array('text' => t('Secondary menu'),'level' => 'h2','class' => array('element-invisible')))); ?>
    </nav>
    <?php endif; ?>
    <?php print $content; ?>
  </div>
</div>

To get the same classes on the menu and menu items I added this to my template.php.

function MYTHEME_menu_tree__main_menu($variables) {
  return '<ul id="main-menu" class="links inline clearfix main-menu">' . $variables['tree'] . '</ul>';
}

function MYTHEME_menu_link__main_menu(array $variables) {
  $element = $variables['element'];
  $sub_menu = '';

  if ($element['#below']) {
    $sub_menu = drupal_render($element['#below']);
  }
  $output = l($element['#title'], $element['#href'], $element['#localized_options']);
  $element['#attributes']['class'][] = 'menu-'.$element['#original_link']['mlid'];
  return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . "</li>\n";
}
2pha’s picture

Woops....seems menu_tree_page_data() only returns the lower levels if they are in the active trail.
Maybe use menu_tree_all_data() instead, though you don't seem to get the active classes. :(

Anonymous’s picture

well this is stupid why not add the dr0p down menu function to the theme?

alexander.sibert’s picture

Version: 7.x-3.x-dev » 7.x-3.1

I tried your code and it works well. Only the last code works not for me.

function MYTHEME_menu_tree__main_menu($variables) {
  return '<ul id="main-menu" class="links inline clearfix main-menu">' . $variables['tree'] . '</ul>';
}

function MYTHEME_menu_link__main_menu(array $variables) {
  $element = $variables['element'];
  $sub_menu = '';

  if ($element['#below']) {
    $sub_menu = drupal_render($element['#below']);
  }
  $output = l($element['#title'], $element['#href'], $element['#localized_options']);
  $element['#attributes']['class'][] = 'menu-'.$element['#original_link']['mlid'];
  return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . "</li>\n";
}
alexander.sibert’s picture

Title: Drop down menus not working » Now it working for me
Version: 7.x-3.1 » 7.x-3.x-dev

but i need following Schema:

		<nav>
			<ul id="nav" role="navigation">
				<li class="top-level item-with-ul"><a href="" class="link-with-ul">Item #1</a>
					<ul class="sub-menu">
						<li><a href="#content">Sub 1 Item #1</a></li>
						<li><a href="">Sub 1 Item #2</a></li>
						<li><a href="">Sub 1 Item #3</a></li>
						<li><a href="">Sub 1 Item #4</a></li>
					</ul>
				</li>

				<li class="top-level item-with-ul"><a href="" class="link-with-ul">Item #2</a>
					<ul class="sub-menu">
						<li><a href="">Sub 1 Item #1</a></li>
						<li><a href="">Sub 1 Item #2</a></li>
						<li><a href="">Sub 1 Item #3</a></li>
					</ul>
				</li>

				<li class="top-level"><a href="">Item #3</a>
				</li>
				<li class="top-level item-with-ul"><a href="" class="link-with-ul">Item #4</a>
					<ul class="sub-menu">
						<li><a href="">Sub 1 Item #1</a></li>
						<li><a href="">Sub 1 Item #1</a></li>
						<li><a href="">Sub 1 Item #1</a></li>
					</ul>
				</li>

				<li class="top-level"><a href="">Item #5</a>
				</li>			
			</ul>											
		</nav>
2pha’s picture

you are going to have to implement that yourself neofelis1985.
Amend the function above.

fubhy’s picture

Title: Now it working for me » Drop down menus not working
originalusrnm’s picture

Where are the Menu settings in Omega? Can't find them anywhere.

2pha’s picture

There are no menu settings. Some of the comments in this thread relate to an older version of Omega.
If you want dropdown menus you should use a module like nice menus or implement them yourself.