1) Currently using a custom made Bootstrap sub-theme for Bootstrap 3 (stable release version)
2) Using Views and default Drupal 7 Main Menu right now.
3) Dropdowns do become active, but do not dropdown when clicked. Nothing happens when clicked.
4) It would be informative for Drupal beginners like me that in Bootstrap 3, submenus are called "dropdowns" for navigation programming purposes.

Please fix this issue as soon as possible. This is one of the main things a website has to have.

Cheers.

Comments

stephen Piscura’s picture

Aliek,

Have you set your parent links (those that contain the items to drop down) to "show as expanded" at:

/admin/structure/menu/manage/[your-menu] >> /admin/structure/menu/item/[###]/edit

?

Aliek’s picture

Yes, I do have it expanded properly.

Though I would like to say, that for five minutes the dropdown to Bootstrap worked when I installed the JQuery menu module. Then it stopped working. I take it, with hopes of more salt to it, is that the Bootstrap 3 theme's jQuery is not entirely properly connecting to Drupal 7.

Also, I have no idea how to implement Bootstrap CDN (Please provide clear and careful steps?). Instead of the Bootstrap CDN I am using the Bootstrap Library module.

Other than that I have no idea how to connect jQuery plugins to Bootstrap 3 for Drupal 7.

Any troubleshooting contributions is much appreciated!

Snakehead’s picture

Hi
I have had the same problem/issue, even with the installation of Bootstrap, but I made several mistakes because I am to lazy to read all the manuals ;-).

The Bootstrap Base Theme did work as the Standart theme without the Library and the Module installed, but after installing Module and Library it didn't. But then I found out that I still use falsely «Bootstrap» Base Theme as the Standard-Theme instead of «Bootstrap_SubTheme».

Although I am already not into Bootstrap (with Less and all the other Stuff) I am sure, this is a very good framework. I am at the moment a bit tired of and not motivated using Zen oder Adaptive Theme AT.

Kind regards
Hans

markhalliwell’s picture

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

Thank you Stephen for #1. Knew there must be a simple setting somewhere I was missing.

Jons’s picture

Don’t necessarily need sub-theme - but do need jquery_update module

murthi9772’s picture

-

murthi.karuppan’s picture


Create Sub Theme (bootstrap)

Install and Enable Bootstrap theme
Go to sitename/sites/all/themes/bootstrap/starterkits
Folder list
- Cdn
- Less
- Sass
Cope the cdn folder and paste this location sitename/sites/all/themes/
Now, Rename the cdn folder into bootstrap_subtheme.
Open the bootstrap_subtheme folder, Rename the cdn.starterkit file into bootstrap_subtheme.info.
Now, Flush all Catches.
Click Appearance menu and Change Theme Bootstrap Sub-Theme (CDN) (default theme).


Multilevel submenus with hover in bootstrap

Download SmartMenus jQuery plugin and Unzip. ( https://www.smartmenus.org/download/ )
Copy Smartmenu plugin and paste here /sites/all/themes/bootstrap_subtheme/
Go to /sites/all/themes/bootstrap_subtheme/smartmenus/ and cope addons folder.
Go to /sites/all/themes/bootstrap_subtheme/ and paste addons folder here.
Go to /sites/all/themes/bootstrap_subtheme/smartmenus/ and cope jquery.smartmenus.js file.
Go to /sites/all/themes/bootstrap_subtheme/ and paste jquery.smartmenus.js file here.
Now, go to /sites/all/themes/bootstrap_subtheme/ and delete smartmenus folder.

Cope this below stylesheet line

stylesheets[all][] = addons/bootstrap/jquery.smartmenus.bootstrap.css

And paste here /sites/all/themes/bootstrap_subtheme/bootstrap_subtheme.info end of the file.

Cope this below Scripts lines:

;;;;;;;;;;;;;;;;;;;;;
;; Scripts
;;;;;;;;;;;;;;;;;;;;;

scripts[] = 'jquery.smartmenus.js'
scripts[] = 'addons/bootstrap/jquery.smartmenus.bootstrap.js'

And paste here /sites/all/themes/bootstrap_subtheme/bootstrap_subtheme.info end of the file.

Cope this below Overrides theme_menu_link()

<?php
/**
 * Overrides theme_menu_link().
 */
function bootstrap_subtheme_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']);
    }
    //Here we need to change from ==1 to >=1 to allow for multilevel submenus
    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>'; Smartmenus plugin add's caret
      $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';
      //comment element bellow if you want your parent menu links to be "clickable"
      //$element['#localized_options']['attributes']['data-toggle'] = 'dropdown';
    }
  }
  // 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 . $sub_menu . "</li>\n";
}

And paste here /sites/all/themes/bootstrap_subtheme/template.php end of the file.

murthi.karuppan’s picture

.

jibinjc’s picture

apaderno’s picture

Priority: Major » Normal
Issue tags: -submenu, -dropdown, -Boostrap 3, -navigation
joneal’s picture

#8 Was helpful thanks.