Great work on this theme. I am using it as a base theme and here are a few things I encountered with the latest changes from the 2.x branch and twitter_bootstrap_ui.
After switching to use twitter_bootstrap_ui, the sub theme would not load the bootstrap js and css files, giving off a file_get_contents "failed to open stream" error. It was trying to load them from the active sub theme, when it needed to still load them from the twitter_bootstrap base theme.
Here's a patch that with a few changes.
1) Adds global $base_theme_info, which I use to check if there is a base them and use that info to create a path to the bootstrap files.
3) The $files variable in line 66 of template.php was only outputting the javascript files. This was throwing an error about missing files. So I added array_merge to combine $css and $js there.
2) I also added an include for /includes/modules/menu.inc, since _twitter_bootstrap_local_tasks was being called.
| Comment | File | Size | Author |
|---|---|---|---|
| load-tb-files-with-subtheme.patch | 1.13 KB | squiggy |
Comments
Comment #1
Docc commentedBelieve it or not. This is by design.
If your create a subtheme you should put the bootstrap files in there. This way every theme can have its own files.
If you want one library i suggest using the twitter bootstrap ui module wich has support for the libraries module.
Comment #2
squiggy commentedThank you for explaining.
I still think it would be a good idea to allow a sub theme to pick up css and js files from twitter_boostrap. It is a feature of the theme system to be able to override the base theme's JS and CSS files from a sub theme's .info file. That is what most themers would expect. I think it makes sense to use the twitter_bootstrap_ui + libraries as an alternative to putting the JS/CSS files in the theme.
Comment #3
squiggy commentedReopening. Hope that's cool. Also, I realize some additional work will have to be done. What specifically was the reason to not use the .info file to override bootstrap css and js files in a sub theme?
Comment #4
gagarine commentedI change that as a bug because is not how Drupal themes are supose to work. How say in #3 subtheme can overrhide css and js in the .info if needed.
Comment #5
gagarine commentedSee https://drupal.org/node/171205. And you have to link on the not minimised files so devloper can choose when they want to compress css/js files.
A cool thing would be to link on a main less css than import the bootstrap library. So we can take advantage of less (using the less module to complile the file).
Comment #6
nagiek commentedSlight hijack of thread, since we're talking about sub-theming.
How is everyone dealing with the include files? Don't get me wrong, I like how easy it is to stay organized. My subtheme however, does not automatically detect these files.
Is there another change to the .info file to ease this?
Comment #7
gagarine commentedAgree I'm responsible for the hijack ;) ... but the .info is the correct way to go and it will solve the problem of the subtheme. I will propose a patch asap, the modifications are very simple in fact. The only things i need to check is how to keep the integration with the library module (I personally don't use it, so I didn't code this part yet).
Comment #8
nagiek commentedOh sorry, I meant I was hijacking the thread. I like the idea of using LESS, since Twitter Bootstrap explicitly ships with it.
I was just reading #1441762: Support LESS. I think making a custom
bootstrap.min.cssis the way to go. That way you can use all the variables that ship with Twitter Bootstrap already.Comment #9
Docc commentedAgreed, css/js files should be included through the info file.
Commited to dev, wich includes the non minified files.
Comment #10
gagarine commentedthe commit for reference http://drupalcode.org/project/twitter_bootstrap.git/commit/8c315f8. For me it looks all right.
Comment #11
gagarine commentedIf its committed we have to mark that as fixed. But FYI I try it and it works.
Comment #12
frankbaele commentedcan we close this one?
Comment #13
gagarine commentedYes it's automatic after 2 weeks in fixed.
Comment #14
andregriffin commented