Closed (fixed)
Project:
Bootstrap
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 May 2012 at 14:23 UTC
Updated:
7 May 2013 at 14:40 UTC
I try to exclude CSS and JS on the .info of a subtheme without success. If I do it directly in twitter_bootstrap theme it works.
The problem certainly append in twitter_bootstrap_theme_get_info called by twitter_bootstrap_css_alter and twitter_bootstrap_js_alter.
Comments
Comment #1
kalabroIt works for my subtheme fine both for css and js.
Comment #2
frankbaele commentedComment #3
jhuon commentedIn order to benefits from all the LESS functions, I personnaly use my own compiled version of Bootstrap.
I try to exclude the Twitter Bootstrap CSS and JS files with no luck. Here's what my sub-theme .info file looks like:
Comment #4
andregriffin commentedComment #5
RobKoberg commentedI have the same problem. I am trying to exclude the bootstrap pre-compiled JS and CSS for some of my multi-sites (using compass and SASS instead). An example theme .info file is:
name = Read for My School - UK
version = 2.0
core = 7.x
base theme = bootstrap
stylesheets[all][] = css/style.css
;scripts[] = js/bootstrap.js
scripts[] = js/bootstrap-transition.js
;scripts[] = js/bootstrap-affix.js
scripts[] = js/bootstrap-alert.js
scripts[] = js/bootstrap-button.js
;scripts[] = js/bootstrap-carousel.js
scripts[] = js/bootstrap-collapse.js
scripts[] = js/bootstrap-dropdown.js
scripts[] = js/bootstrap-modal.js
;scripts[] = js/bootstrap-scrollspy.js
scripts[] = js/bootstrap-tab.js
scripts[] = js/bootstrap-tooltip.js
scripts[] = js/bootstrap-popover.js
;scripts[] = js/bootstrap-typeahead.js
;scripts[] = js/jquery.timeago.js
scripts[] = js/tempo.js
exclude[js][] = 'bootstrap/js/bootstrap.js'
exclude[css][] = 'bootstrap/css/bootstrap.css'
exclude[css][] = 'bootstrap/css/bootstrap-responsive.css'
Comment #6
RobKoberg commentedTo be a little more clear on this, you would have needed to download the bootstrap precompiled directory/files into the main bootstrap theme directory. I am doing this because as a new site in a multi-site environment is started, they won't have styles yet or even a subtheme. I have a custom install profile select the bootstrap theme instead of the theme the standard install profile uses.
Comment #7
frankbaele commentedyes, i dont think the current code holds subthemes in account, but it shouldn't be that hard to fix. The problem lays within the fact that the code only checks the current themes code and doesnt consider the fact there maybe is a subtheme. I think the solution lays within the code written in conditional stylesheest module.
Comment #8
RobKoberg commentedWe can get around this issue if we do something like:
What do you think?
Comment #9
mmowers commentedI had a similar problem and found that basing the exclude[] statement path on the drupal root was the solution. For example, to exclude bootstrap-responsive.css, I am using this statement:
exclude[css][] = 'sites/all/themes/bootstrap/bootstrap/css/bootstrap-responsive.css'
and it seems to work fine.
Comment #10
natted commentedI've been working on a solution for this (which also relates to a few other open issues).
I'm at Drupalcon Sydney this week but will try update with a proposed patch asap.
Comment #11
chriz001 commentedI managed to do this with the following code
; Exclude
stylesheets[all][] = bootstrap/css/bootstrap.css
stylesheets[all][] = bootstrap/css/bootstrap-responsive.css
http://drupal.org/node/263967
Comment #12
robertom commentedHi, sorry for my bad english.
I've solved this issue with this code:
inside my subtheme.info I've wrote
after that, I've created a template.php for my subtheme with
obviously you need to replace the word "subtheme" in the template.php file with the name of your theme
Comment #13
markhalliwellThis isn't a problem with the new sub-theme methods added with the #1844448: Add sub-theme starter kit commit. Now, a sub-theme must either use the Boostrap CDN or supply it's own CSS and JS. There isn't a need for excluding anything as the base theme no longer attempts to load the Bootstrap library.
Comment #14.0
(not verified) commentedit works in the base theme