Because Bootstrap adds bootstrap.js in a js_alter, it's very difficult to make alterations to it (for example, setting the scope of all JS files to footer) at the module level.

Better approach might be to add it in the info file, and simply alter the relevant locations/types/weights according to settings rather than doing the actual file addition there.

I think the same could be said of the CSS as well.

Comments

andregriffin’s picture

Yes, this needs to be done for js. It was sort of taken care of for the CSS with this issue: #1858418: Make set location of the bootstrap library more easily modified.

frankbaele’s picture

Status: Active » Needs review
StatusFileSize
new3.58 KB

added a patch to fix this problem and while is was in that code, also removed the jquery cdn in favor of using the jquery update module.

The reason why i propose to remove my own jquery cdn code, its not a bad solution but i think we should choose one way too update the jquery version. And the most commonly used way is the jquery update module.

http://drupal.org/node/1846736

Status: Needs review » Needs work

The last submitted patch, remove_jquery_cdn_and_use_info_file.patch, failed testing.

frankbaele’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, remove_jquery_cdn_and_use_info_file.patch, failed testing.

wundo’s picture

Hi Frank,
Could you break the patch in two?

There is a separated issue for the jquery-cdn thing.

Cheers,
Fabiano

frankbaele’s picture

no problem

k4v’s picture

I think the cleanest way to handle the JS is to put it in a helper module with library support. That way we can also make use of the modular Javascript in Bootstrap, and only include parts needed in a project.

Check out http://drupal.org/project/bootstrap_api.

I'm working with blackice2999 on this. We would appreciate it, if we could join our efforts here.

markhalliwell’s picture

Version: 7.x-3.x-dev » 7.x-2.x-dev
Status: Needs work » Fixed

This isn't a problem with the new sub-theme methods now committed to dev via #1844448: Add sub-theme starter kit. A sub-theme must either use the Boostrap CDN or supply it's own CSS and JS. The base theme no longer attempts to load the Bootstrap JS unless specified as using the CDN.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.