Joomla! 3.1, Remove Bootstrap

2020-04-08 06:54发布

问题:

I want to completely remove bootstrap from my Joomla 3 website, not to display tool-tips on the front-end. I tried almost everything and have read almost every article on the topic but cannot find the correct solution.

The fact is that it is not so hard to remove it but I want to remove it permanently so that no update can undo my changes.

Is there a way to complete this task?

回答1:

It is not enough to remove from template and modules few lines. My solution is to create a plugin:

class plgSystemYourPlugin extends JPlugin
{
    public function onBeforeCompileHead()
    {
        // Application Object
        $app = JFactory::getApplication();

        // Frontend
        if( $app instanceof JApplicationSite )
        {
            $doc            = JFactory::getDocument();
            // Remove default bootstrap
            unset($doc->_scripts[JURI::root(true).'/media/jui/js/bootstrap.min.js']);
        }
    }
}

It works in Joomla! 3.2 - 3.6.



回答2:

You can override jquery and/or bootstrap in your template. While not ideal, this solution worked for me: http://osdir.com/ml/joomla-development/2012-12/msg00475.html