In plain Drupal site with bootstrap sub-theme, I added a menu items to Navigation menu, while I click to Article101, it should lead to Article101 and show its child menu, but both is not happening, Just menu-item is not responding anything?

  -Article101
    -Article102

Any idea what could be the issue? Thanks

Comments

Codenext created an issue. See original summary.

tannguyenhn’s picture

Please make sure when you create menu item Article101, you should checked on option "Show as expanded"

dev18.addweb’s picture

You can use superfish module to create menu in your site.

Codenext’s picture

@tannguyenhn, Yes I am aware of that, and I enabled it, still not working.

Codenext’s picture

@naresh.bavaskar, I will use superfish module, but that is the secondary thing. This looks like core theme issue.

tannguyenhn’s picture

@Codenext
You created subtheme from bootstrap base theme ? Maybe some thing wrong with your subtheme.
You can switch back to base theme bootstrap for test. I am working on project use bootstrap theme and it worked as well.

willito’s picture

For anyone who came across this limitation of menu depth, you can do the following to render subnav items.

First of all, create a menu-link.func.php file in your subtheme . Write something like this:

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

  if ($element['#below']) {
    // Prevent dropdown functions from being added to management menu so it
    // does not affect the navbar module.
    if (($element['#original_link']['menu_name'] == 'management') && (module_exists('navbar'))) {
      $sub_menu = drupal_render($element['#below']);
    }
    elseif ((!empty($element['#original_link']['depth'])) && ($element['#original_link']['depth'] == 1)) {
      // Add our own wrapper.
      unset($element['#below']['#theme_wrappers']);
      $sub_menu = '<ul class="dropdown-menu">' . drupal_render($element['#below']) . '</ul>';
      // Generate as standard dropdown.
      $element['#title'] .= ' <span class="caret"></span>';
      $element['#attributes']['class'][] = 'dropdown';
      $element['#localized_options']['html'] = TRUE;

      // Set dropdown trigger element to # to prevent inadvertant page loading
      // when a submenu link is clicked.
      $element['#localized_options']['attributes']['data-target'] = '#';
      $element['#localized_options']['attributes']['class'][] = 'dropdown-toggle';
      $element['#localized_options']['attributes']['data-toggle'] = 'dropdown';
    }

    if (SOME CONDITION SPECIFIC TO YOUR USE CASE) {

      $sub_menu = drupal_render($element['#below']);
    }
  }
  // On primary navigation menu, class 'active' is not set on active menu item.
  // @see https://drupal.org/node/1896674
  if (($element['#href'] == $_GET['q'] || ($element['#href'] == '<front>' && drupal_is_front_page())) && (empty($element['#localized_options']['language']))) {
    $element['#attributes']['class'][] = 'active';
  }
  $output = l($element['#title'], $element['#href'], $element['#localized_options']);
  return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $expand_button . $sub_menu . "</li>\n";
}

This limitation on behalf of the bootstrap theme is intentional, and does comply with some best practices. This is an imperfect solution to a common problem we find ourselves with: super-deep menu trees!

I hope this helps.

vidit.anjaria’s picture

There must be some error you can find in console which causing this issue. As said in Comment #6 check with base theme, it's working properly..

Darth_Beholder’s picture

I can confirm that neither child neither base theme does not display child items in parent menus.
In standart themes (bartik/garland) child items are shown.
#7 solution is not working for me.
------------------
Sorry, my bad. After installing jquery update, menu works.

markhalliwell’s picture

Status: Active » Closed (duplicate)
Related issues: +#1893532: [bootstrap][policy][7.x-3.x] Navigation/Menus
Bruno Vincent’s picture

In what folder do I put:

menu-link.func.php

And do I have to modify settings.php, info file or htacess?

dnlt’s picture

@bruno-vincent (#11),
You can place it at /templates directory. You can add a directory level, if you want to keep it clean; drupal will find it anyway.
I suppose you already found it, but I'd like to add for future visitors.