Fix Bootstrap Sub Menu Not Appearing in Drupal 7

 I use Drupal 7 for development and configuration on a local server. As additional information, I use a Bootstrap template (Custom Subtheme) and the Special Menu Items module. Therefore, when developing the site on a local server, the JavaScript files will use the Bootstrap template/JavaScript files from localhost.

The issue arises when I deploy the Drupal site and use a CDN. There is a problem with the Special Menu Items module for the <nolink> element, where the sub-menu doesn't appear when clicked. It's not just that; there are also issues with the Bootstrap modal.

This problem occurs due to a conflict between the Bootstrap CDN file and/or the localhost JQuery file with the CDN. Therefore, you need to disable the local JavaScript files when using the CDN.

To resolve this issue, please open the subtheme or respective theme file and disable the JavaScript file directed to the local server by adding a semicolon, as shown below:

;; Stylesheets

stylesheets[all][] = bootstrap/css/bootstrap.min.css
stylesheets[all][] = css/style.css

;; Scripts

;scripts[] = 'bootstrap/js/affix.js'
;scripts[] = 'bootstrap/js/alert.js'
;scripts[] = 'bootstrap/js/button.js'
;scripts[] = 'bootstrap/js/carousel.js'
;scripts[] = 'bootstrap/js/collapse.js'
;scripts[] = 'bootstrap/js/dropdown.js'
;scripts[] = 'bootstrap/js/modal.js'
;scripts[] = 'bootstrap/js/tooltip.js'
;scripts[] = 'bootstrap/js/popover.js'
;scripts[] = 'bootstrap/js/scrollspy.js'
;scripts[] = 'bootstrap/js/tab.js'
;scripts[] = 'bootstrap/js/transition.js'

Save the file, and the problem should be resolved using this method.

0 Response to "Fix Bootstrap Sub Menu Not Appearing in Drupal 7"

Post a Comment

Komentar yang Anda kirim akan terlebih dahulu di moderasi oleh Admin