Re: Knowing if bootstrap is used by the current template

1,611 views
Skip to first unread message

elin

unread,
Sep 6, 2012, 7:33:49 PM9/6/12
to joomla-...@googlegroups.com
How would you define what it means? 

Elin
On Wednesday, September 5, 2012 4:52:40 PM UTC-4, Jerome G wrote:
Hi,

Is there a way or something which could be implemented in order to know if bootstrap is used by the current template ?
In the front-end or the backend, it would be interesting for component to have this information.

Component should be compatible with bootstrap and non bootstrap templates.

Regards,

reynaldo celaya III

unread,
Sep 7, 2012, 3:52:32 PM9/7/12
to joomla-...@googlegroups.com
A standardized way of including bootstrap.js

currently in prostar bootstrap is loaded in the head via script tag not via JHtml::_

There needs to be two functions:

JHtml::_('behavior.bootstrap'); //to load bs

JHtml::_('behavior.isloaded',"bootstrap"); //to check if loaded

behavior stores all loaded files in a static array self::$loaded that can be tested if bootstrap is loaded

Dont have time to implement but this would work

Rouven Weßling

unread,
Sep 7, 2012, 3:55:51 PM9/7/12
to joomla-...@googlegroups.com

On 07.09.2012, at 21:52, reynaldo celaya III <rcel...@gmail.com> wrote:

> A standardized way of including bootstrap.js

We already do that. It's JHtml::_('bootstrap.framework')

> There needs to be two functions:
>
> JHtml::_('behavior.bootstrap'); //to load bs

See above.

> JHtml::_('behavior.isloaded',"bootstrap"); //to check if loaded

Why? If you need the JS just call JHtml::_('bootstrap.framework') again, we take care it isn't loaded twice.

Best regards
Rouven

reynaldo celaya III

unread,
Sep 7, 2012, 4:31:24 PM9/7/12
to joomla-...@googlegroups.com

We already do that. It's JHtml::_('bootstrap.framework')

didnt find it in alpha2 release (any call to it were commented out ), I need to get on beta1


Michael Babker

unread,
Sep 7, 2012, 8:09:49 PM9/7/12
to joomla-...@googlegroups.com
The methods weren't there for alpha2.  The methods probably should've been coded while the UX work was still in its separate branch, but alas, they are in the core now and (hopefully) do a well enough job of not only loading themselves and registering as such, but loading their dependencies if needed so that developers don't need to call every JS script that a certain method needs.

--
You received this message because you are subscribed to the Google Groups "Joomla! CMS Development" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-cms/-/j4DiC7PJb3wJ.
To post to this group, send an email to joomla-...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-cm...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-cms?hl=en-GB.

Jerome G

unread,
Sep 8, 2012, 9:49:02 PM9/8/12
to joomla-...@googlegroups.com
Having a good way to include bootstrap and for extension design too.

If the template isn't a bootstrap template (I'm thinking about front-end part), the component should not use bootstrap styles.
With bootstrap, component would be able to use "grid12" design, responsive css, bootstrap images, bootstrap menus, etc.

I am thinking about Joomla extensions and Joomla templates too.
A template could not have a bootstrap design so, extensions should not use the bootstrap css rules with these templates.
Using a grid12 organization if bootstrap is not used by the template could break the template or do not work properly.

Does extensions would have to force the inclusion of bootstrap.css ?
Bootstrap.css breaks a lot of rules for classical design, some classes or id could be used in current templates and make conflicts.

So I think that extensions could change their design depending of the bootstrap inclusion.
Some could include and use it, some could include their own special css file in order to keep the compatibility (with rules using special id for example), some could have several design...

Regards,
Jerome

Matt Thomas

unread,
Sep 9, 2012, 8:00:33 AM9/9/12
to joomla-...@googlegroups.com

Hi Jerome,

I completely understand and share your concerns. However, after conversing with Kyle Ledbetter about this on Twitter, I learned that the "new paradigm" is that all extensions must use Bootstrap to be compatible with one another. In other words, if a Joomla 3.x extension chooses not use Bootstrap, it runs the risk of breaking on 3.x.

Best,

Matt Thomas
Founder betweenbrain™
Lead Developer Construct Template Development Framework
Phone: 203.632.9322
Twitter: @betweenbrain
Github: https://github.com/betweenbrain

Composed and delivered courtesy of Nexus 7.

To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-cms/-/6mJPTfPV_2EJ.

reynaldo celaya III

unread,
Sep 10, 2012, 4:24:22 PM9/10/12
to joomla-...@googlegroups.com
 In other words, if a Joomla 3.x extension chooses not use Bootstrap, it runs the risk of breaking on 3.x.

This is good news for me and other extension developers, we hopefully can depend on bootstrap being used, and not worry about the gantrys, and zen grids,warp...etc..etc... on and on...... and all that duplicate js/css, that does the same thing.

Bad news for the template developers who invested all that time into their own frameworks (In my opinion,bootstap is by far better).

Reply all
Reply to author
Forward
0 new messages