Martin Omacht
Martin Omacht

Reputation: 425

Joomla - Bootstrap not working properly

I am changing a website into a template for Joomla 3.4.3. I am using Bootstrap 3 components and they've been working great normaly, but when it is as a Joomla template they are not working properly. Navigation toggle works only sometimes, carousel is acting weird and some animations aren't working. Also in firefox I am getting this error whenever I click somewhere:

Empty string passed to getElementById()

and it's refering to this code in jQuery:

// HANDLE: $(#id)
} else {
    elem = document.getElementById( match[2] ); // Here the error occurs

I've read that it can be caused by having duplicate IDs in HTML, but I have checked and didn't find any.

I would really appreciate your help, I'm really frustrated by this. Thanks

Upvotes: 0

Views: 1145

Answers (2)

Jose Luis Algara
Jose Luis Algara

Reputation: 175

To avoid conflicts, how not to load js files it is as follows:

unset($doc->_scripts[$this->baseurl.'/media/jui/js/bootstrap.min.js']);

In this case, we remove the bootstrap.min.js joomla file loaded by default.

I hope I've been helpful. Sorry for my English.

Upvotes: 1

Jose Luis Algara
Jose Luis Algara

Reputation: 175

I think the problem is that the heart of joomla currently works with version 2.3.2 Bootstrap

You need to load in the template, bootstrap version you want to use.

Create a directory called "js" in the template and one for the "css"

Then add this in the template, after placing files.

$doc->addScript($tpath.'/js/bootstrap.min.js');
$doc->addStyleSheet($tpath.'/css/bootstrap_3.css');

Upvotes: 2

Related Questions