Unload BootStrap and jQuery

Everything to do with Joomla! 3.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
User avatar
pedro1966
Joomla! Apprentice
Joomla! Apprentice
Posts: 36
Joined: Wed Sep 17, 2008 8:29 am
Location: Germany
Contact:

Unload BootStrap and jQuery

Post by pedro1966 » Sat Nov 17, 2012 3:13 pm

Hi all,
first at all I want to say that the Joomla 3.0 is really good ( at the backend).
But at the frontend I dont need this terrible Bootstrap with jQuery. And the other things is, that Mootools is loading at the frontend too.

OK, back to topic.
I want to unload the jQuery scripts. I have deleted the string:

Code: Select all

// Add JavaScript Frameworks
JHtml::_('bootstrap.framework');
But the frontend is always loading the jquery and bootstrap !!

How can I disable the Bootstrap loading?

MrValentin
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Mon Oct 15, 2012 12:01 am

Re: Unload BootStrap and jQuery

Post by MrValentin » Tue Nov 20, 2012 11:11 pm

I don't know how to fix your problem in an easy way, but I think I can at least point you in the right direction.

In /templates/protostar/index.php you will find this line:

Code: Select all

<jdoc:include type="head" />
It's used to load this file:
  • /Joomla/libraries/joomla/document/html/renderer/head.php
In it, if for example you delete this:

Code: Select all

		// Generate script file links
		foreach ($document->_scripts as $strSrc => $strAttr)
		{
			$buffer .= $tab . '<script src="' . $strSrc . '"';
			if (!is_null($strAttr['mime']))
			{
				$buffer .= ' type="' . $strAttr['mime'] . '"';
			}
			if ($strAttr['defer'])
			{
				$buffer .= ' defer="defer"';
			}
			if ($strAttr['async'])
			{
				$buffer .= ' async="async"';
			}
			$buffer .= '></script>' . $lnEnd;
		}
You won't have any of the scripts joomla usually loads. Of course, it would be better to have an override rather than modifying joomla's core files. I am not sure what's the best way to do that, but maybe this site will help you.


Anyway, I am sure someone will come across this topic and be able to help you better than I.

Good luck still.

designsubway
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 151
Joined: Fri Apr 16, 2010 3:03 pm
Location: Scarborough, UK
Contact:

Re: Unload BootStrap and jQuery

Post by designsubway » Tue Mar 12, 2013 4:14 pm

Hi
You could try

Code: Select all

<?php unset($this->_scripts[JURI::root(true).'/media/jui/js/bootstrap.min.js']); ?>
in your index.php file.

If you site is still loading bootstrap then it sounds as though a module/plugin is loading it. Try turning them off in turn to see it it works.
Director / Designer at Betton Design Ltd, Scarborough.
https://bettondesign.co.uk/

User avatar
klipper
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Tue Nov 22, 2005 10:03 pm
Location: Netherlands

Re: Unload BootStrap and jQuery

Post by klipper » Wed Mar 13, 2013 4:58 pm

Remember:
Extension-developers for Joomla! 3 expect that you use Bootstrap in your frontend. If you disable Bootstrap in your template some extensions will not work on your site.

ovcharoff
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Sat Feb 04, 2012 9:49 pm

Re: Unload BootStrap and jQuery

Post by ovcharoff » Tue Aug 06, 2013 4:29 pm

designsubway wrote:Hi
You could try

Code: Select all

<?php unset($this->_scripts[JURI::root(true).'/media/jui/js/bootstrap.min.js']); ?>
in your index.php file.

If you site is still loading bootstrap then it sounds as though a module/plugin is loading it. Try turning them off in turn to see it it works.
Thank you ! That solved the very irritating problem with Joomla pagination doing strange things when hovered :) Now my pagination works as expected.

Thank you again !

cpk377
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Aug 09, 2013 4:19 pm

Re: Unload BootStrap and jQuery

Post by cpk377 » Fri Aug 09, 2013 6:05 pm

I am wondering how to do the opposite of this. I have a custom template and want to be able to use jQuery in my scripts file. I have added JHtml::_('jquery.framework');after $app = JFactory::getApplication(); above <head>. Not sure what else I need to do. Also when I do get it working do I have to use jQuery instead of $ to access the jquery object?

User avatar
Poznakomlus
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Tue May 29, 2012 10:25 am
Location: Ukraine
Contact:

Re: Unload BootStrap and jQuery

Post by Poznakomlus » Thu Aug 22, 2013 6:42 pm

https://github.com/Poznakomlus/joomla_options.git
Plug-in for managements of built-in libraries Joomla V 2.5-3.
Main options:
Mootools disable
Jquery disable
Bootstrap disable

krealm
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Nov 14, 2013 2:29 am

Re: Unload BootStrap and jQuery

Post by krealm » Wed Jan 08, 2014 6:05 am

You can override jquery and/or bootstrap in your template. While not ideal, this solution worked for me: http://osdir.com/ml/joomla-development/ ... 00475.html
Last edited by alikon on Wed Jan 08, 2014 6:43 am, edited 1 time in total.
Reason: corrected url

pieter-jan
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Wed Mar 09, 2016 12:00 pm

Re: Unload BootStrap and jQuery

Post by pieter-jan » Tue Jul 26, 2016 2:45 pm

designsubway wrote:Hi
You could try

Code: Select all

<?php unset($this->_scripts[JURI::root(true).'/media/jui/js/bootstrap.min.js']); ?>
in your index.php file.

If you site is still loading bootstrap then it sounds as though a module/plugin is loading it. Try turning them off in turn to see it it works.
this answer is actually a livesaver for those who choose to work with more recent versions of bootstrap instead of the default 2.5 joomla loads. Disable default bootstrap using this trick and then load more recent bootstrap manually. No negative effects so far for me, but solved a lot of javascript issues like indicators not working etc...

User avatar
changlee
Joomla! Explorer
Joomla! Explorer
Posts: 378
Joined: Tue Nov 20, 2007 11:05 am
Location: Greece
Contact:

Re: Unload BootStrap and jQuery

Post by changlee » Wed Jul 27, 2016 9:23 am

At the most new templates, we have the option to enable/disable BootStrap, jquery etc...
If you do not programm your life, someone else will do it for you.
FREE SMTP Newsletter at: https://www.emailbat.com Free and low cost Templates at: https://www.b2b-templates.com


Locked

Return to “Templates for Joomla! 3.x”