Skip Navigation

[Resolved] basic Bootstrap Accordions not working after moving site to Divi theme

This support ticket is created 4 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 5 replies, has 2 voices.

Last updated by Michael 4 years, 2 months ago.

Assisted by: Christian Cox.

Author
Posts
#1863595

I have basic custom HTML in an HTML block to allow search fields to be contained within a Bootstrap accordion. We recently moved over to the Divi theme from Colibri where the accordion panels worked fine.

Page(s) in question do not use Divi builder - built with Gutenberg:

hidden link

Am in touch with Divi who tell me to talk to you Toolset ....

#1863753

Apologies - I failed to describe the issue .... the accordions no longer expand on click so users cannot access the actual search filters within.

I am talking to Divi, too, but they are fairly insistent that issue will sit with Toolset ..... i just need it to work.

#1863951

Okay we can try a couple of things. First, it's possible that Bootstrap is enqueued by another component of the site. To test that, you can go to Toolset > Settings > General and select the option that says Bootstrap is already loaded on this site. Then test again. You can also test to see if changing the Bootstrap version makes any difference. There are some subtle differences between BS 3 and BS 4 that might be at play here, hard to say offhand but it would be easy to test.

If Bootstrap settings do not resolve the problem, we can try to take Toolset out of the equation to try to determine whether or not it's a Toolset issue. Temporarily deactivate Toolset plugins and enqueue Bootstrap 4 manually in your child theme:
https://scanwp.net/blog/learn-how-to-add-style-and-script-files-to-wordpress-correctly/

Then, place a similar collapsible structure in the HTML content of a custom Page:

<div class="panel-group" id="accordion">
      <div class="panel panel-default">
         <div class="panel-heading">
            <h4 class="panel-title">
               <a data-toggle="collapse" data-parent="#accordion" href="#collapse2">Languages</a>
            </h4>
         </div>
         <div id="collapse2" class="panel-collapse collapse show" aria-expanded="false" style="">
            test
         </div>
      </div>
      <div class="panel panel-default">
         <div class="panel-heading">
            <h4 class="panel-title">
               <a data-toggle="collapse" data-parent="#accordion" href="#collapse3">Organisations</a>
            </h4>
         </div>
         <div id="collapse3" class="panel-collapse collapse" style="">
            test
         </div>
      </div>
      <div class="panel panel-default">
         <div class="panel-heading">
            <h4 class="panel-title">
               <a data-toggle="collapse" data-parent="#accordion" href="#collapse4">Regions</a>
            </h4>
         </div>
         <div id="collapse4" class="panel-collapse collapse" style="">
            test
         </div>
      </div>
   </div>

We can then test to see if the accordion collapses and expands as expected.

#1864055

I had already worked thru the various options re: Bootstrap loading options in the settings - but have repeated the process with no joy.

I have also deactivated all Toolset elements and added the enqueue function as directed (using most recent Bootstrap 4) with no joy either ..... accordion panels all presented expanded but would not change state.

I am thinking this rules out Toolset as the problem? If not, what next? If Toolset is ok do you know of any resource for getting my head around basic styling of search fields beyond what it offered in standard block options?

#1864083

Ok, problem has been resolved - was an issue with Divi but would probably be useful for Toolset community to understand the issue.

Basically Bootstrap needs to focus on #'s for their accordion/panels AND Divi uses the same # for their approach to Smooth Scrolling and that was over ridding Bootstrap. Solution was to add a new CSS class to identify Bootstrap expansion elements and a bit of jQuery to exclude those from Smooth Scrolling.

Thanks for the help all the same 🙂

#1864085

My issue is resolved now. Thank you!