I just hit the drop-down menu issue as described in Issue #2689665. There @Jaya M described that they had to remove the dropdown.js line from their THEMENAME.libraries.yml file to get drop down menus to work in Bootstrap. I've done this just now and it works great.

I was confused by the resolution there.

If this is a "works as designed" fix, shouldn't:

bootstrap/starterkits/less/THEMENAME.libraries.yml
bootstrap/starterkits/sass/THEMENAME.libraries.yml

be modified to remove this line?

    bootstrap/assets/javascripts/bootstrap/dropdown.js: {}

It seems a strange fix too. Why is bootstrap behaving in this way?

Comments

TrevorBradley created an issue. See original summary.

markhalliwell’s picture

Category: Bug report » Support request
Status: Active » Closed (works as designed)

No.

These starterkits are intended for manually complied resources that don't use the CDN.

My guess is that there is still a "global" bootstrap JS file being loaded somewhere (likely from the CDN, so the sub-theme didn't disable it like it should have).

What is likely happening is that the global bootstrap JS loads first, then your sub theme's.

This causes the two toggle bindings to be created.

When you actually click a menu item, it does open (global bootstrap JS binding), but immediately closes because of the sub-theme toggle binding.

Thus, the end result is that "nothing happens".

If a sub-theme were setup properly, you wouldn't be running into this issue.

TrevorBradley’s picture

Sorry to jump back in here, but you've not made it clear were the fault lies.

I've checked my source code, and the subtheme does appear to be loading the CDN library. If I disable the CDN (Theme settings > Advanced > CDN > CDN Provider: none), then re-add the dropdown.js to my {THEMENAME}.libraries.yml file, the site works properly. I suspect this is what you were referring to.

However, the documentation for setting up a LESS subtheme doesn't talk about disabling the CDN. Only about adding the local bootstrap libraries.

The CDN setup page for the subtheme also doesn't make it clear that the CDN libraries should be disabled for a subtheme.

Perhaps this is obvious to the devs, but is it possible there's a documentation fault?

TrevorBradley’s picture

Title: LESS/SASS Bootstrap Starter Kits have non-working dropdown menus » LESS/SASS Bootstrap Starter Kit documentation incomplete (disable CDN?)
Component: Starterkit (LESS) » Documentation
Status: Closed (works as designed) » Active
markhalliwell’s picture

Status: Active » Closed (works as designed)

There's no "fault", just misunderstanding and confusion on your part.

Yes, that is what I was referring to. However, what you did manually (in the theme settings) should have been done automatically for you when the sub-theme was installed.

So it is, semi-documented, albeit, somewhat indirectly via step #5 on http://drupal-bootstrap.org/api/bootstrap/docs%21Sub-Theming.md/group/su...

If the file was renamed properly, then the following would have been installed:
http://drupal-bootstrap.org/api/bootstrap/starterkits%21sass%21config%21...

Also, there's a slight assumption that if you're installing either the LESS or SASS starterkit, you're venturing on advanced territory and would understand that the CDN would have to be disabled (as you'd be fighting styles, JS and a whole slew of other performance issues).

TrevorBradley’s picture

Darn it. I can verify I missed Steps 5 and 6 on the Subtheming page, modifying:

./THEMENAME/config/install/THEMENAME.settings.yml 
./THEMENAME/config/schema/THEMENAME.schema.yml.

I'm too used to modifiable files living in a sub-theme root.

Thanks for your assistance!