User tests: Successful: Unsuccessful:
According to this topic https://groups.google.com/forum/#!topic/joomla-dev-general/c--P-HTzMzc the protostar (and any other Joomla 3) template should load the core bootstrap and extend it with it's own markup. How to adapt the CSS and Less files is outside of my knowledge :-(
This is a first step to solve the following tracker item http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=31402
This will create backward compatibility breaks for each and every template which uses Bootstrap markup.
Now you start messing with Bootstrap itself. For that you would have to edit the LESS files first, and then compile back the CSS files.
But really, we don't want to mess with those files more than needed. Namespacing Bootstrap is not something we should be doing. It would make updating Bootstrap a nightmare and would only confuse users who rely on the Bootstrap doc.
Really, you're trying to solve an issue you created within your extension. Don't loadCSS in your extension. You're not supposed to do that.
This issue doesn't have to do with my extensions. I mean you can't say don't call loadCss it is there and will be called for sure. If not by me then for sure by others....it was one of the first solution in the mailing list who was posted.
Yeah, but loadCSS is not a solution even if it was mentioned there. The function is meant to be used by templates, not by extensions.
However I think it shouldn't even be used by templates, they should instead compile their own CSS file. There is no point in having the browser load four CSS files if it could only load one instead.
First, PLEASE do not change the bootstrap*.css files in media/jui/css
. These are the stock Bootstrap CSS files, pure, straight from the source. We do provide those for users who just want to load Bootstrap then hack away via their own CSS (these are the beginner users who don't have the means to work with LESS).
Second, as stated before, this is a massive B/C break, and possibly breaks Bootstrap itself (container is a Bootstrap core class, changing it to jcontainer will have consequences).
I'm closing this PR on the grounds that the code as presented is NOT a viable solution at this point in time. Discussions can continue here or on the mailing list about this (and other Bootstrap related) issue(s).
I'm not changing container to jcontainer...the only thing what I did I wrapped all into jcontainer. Here is an explanation how to do it https://g4j.digital-peak.com/blog/126-how-to-add-bootstrap-to-your-joomla-2-5-extension and what the consequences are
Your code example above reads as <div class="container">
is changed to <div class="jcontainer">
. This change would break the grid system. As for the CSS changes, again as mentioned before, appending everything with a .jcontainer
class completely breaks B/C.
You namespaced the Bootstrap CSS file so it only acts if within a jcontainer. This will break every template which uses the file and doesn't have jcontainer.
We're in the midst of the Joomla 3.x release cycle, you can't just change this file and break all templates relying on it.
The article you linked describes how to include Bootstrap into an extension. And that's exactly what you could do in your own extension to make sure it works. But don't do that globally.
I took out the code that the protostar template will load bootstrap at all and added a namespaced version of bootstrap. Now the code JHtmlBootstrap::loadCSS() will load bootstrap namespaced, which means the following code will work
but this one not