Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Created a new subtheme based on the LESS starterkit. Created few menu entries and submenus under "Main Navigation". For menu entries with submenus, selected "Show as expanded" for parent menu entry. The caret appears showing that there are submenu items for the menu entry, but on clicking the parent menu item nothing happens.
Tried the same with bootstrap base theme without changing any other configuration and now the dropdown menu works.
Generated HTML for both base theme and subtheme looks the same, below is an example for one of the menu entry with submenu.
<ul class="menu nav navbar-nav">
<li> <a href="{link}" data-drupal-link-system-path="node/1">{Parent Manu-1}</a> </li>
<li class="expanded dropdown"> <a href="{link}" class="dropdown-toggle" data-target="#" data-toggle="dropdown">{Parent Menu-2}<span class="caret"></span></a>
<ul class="menu dropdown-menu">
<li> <a href="{link}" data-drupal-link-system-path="{path}">{Sub Menu}</a> </li>
</ul>
</li>
....
</ul>
Comments
Comment #2
Jaya M CreditAttribution: Jaya M as a volunteer commentedComment #3
Jaya M CreditAttribution: Jaya M as a volunteer commentedComment #4
Jaya M CreditAttribution: Jaya M as a volunteer commentedResolved the issue by removing "bootstrap/js/dropdown.js" from {THEMENAME}.libraries.yml file.
Comment #5
markhalliwellComment #6
millionleaves CreditAttribution: millionleaves as a volunteer commentedConfirmed that this issue also occurs for the SASS starterkit, and the solution documented here solves the problem. This is the only place I could find that provided this solution. Adding a new issue to cover adding this instruction to the sub-theming guide.
Comment #7
markhalliwellThere's no need to create a new issue. This is expected behavior if there is more than one plugin (script) being loaded. See my comment here: #2797453-2: LESS/SASS Bootstrap Starter Kit documentation incomplete (disable CDN?).
Comment #8
millionleaves CreditAttribution: millionleaves as a volunteer commentedAh ... got it. I had Bootstrap locally but still had the CDN version enabled as well. Thanks for clarifying.