Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extend, modify, or override Joomla's bootstrap.php?

So I've been playing with Joomla 3 with Bootstrap. At first I didn't fully understand what they meant by Bootstrap being baked into the CMS - seems like you could call it but would have to either use Javascript or template overrides to match the expected output. Not much more convenient than calling the Bootstrap framework manually.

Then I found a few links about libraries/cms/html/bootstrap.php - and there was much rejoicing:

  • http://doc.joomladev.eu/api3/Joomla-Libraries/HTML/JHtmlBootstrap.html;
  • https://groups.google.com/group/joomla-dev-cms/browse_thread/thread/59ede023a635cc78/18f67450a08e66ff?lnk=raot;
  • http://itprism.com/blog/106-bootstrap-tabs-accordion-slides.

This seems to be a work in progress, and the limited links I found indicate that there are some kinks to be worked out. But useful for going forward...especially if I can create or edit my own as needed.

  1. Is there a way of using this file in a template override, like modules.php?
  2. Is there any better documentation than what I listed above?

Thanks!

like image 233
Gisto Avatar asked Nov 20 '25 04:11

Gisto


1 Answers

As a JHtml helper, you would use it like any other JHtml call you see in the CMS. As you probably know, JHtml::_('behavior.framework'); enables MooTools in the CMS. Well, there's a similar function JHtml::_('bootstrap.framework'); that will load the Bootstrap JavaScript as well as its jQuery dependency. So, if you want to enable Bootstrap's alert plugin, just call JHtml::_('bootstrap.alert', 'optionalClassNameForAlertElements'); and you're all set.

Bootstrap has less than a year in the CMS while MooTools has been around for a while, so obviously the support can still be improved upon. But, we've tried to make it easy to quickly enable the various Bootstrap JavaScript plugins so you can focus on front-end work.

like image 124
Michael Avatar answered Nov 22 '25 18:11

Michael



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!