Skip Navigation

[Gelöst] Bootstrap modal is not working

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.

This topic contains 4 Antworten, has 2 Stimmen.

Last updated by marijkeM vor 4 Jahre, 8 Monate.

Assigned support staff: Nigel.

Author
Artikel
#488368

With the latest beta (1.9 -b4) the Bootstrap modal doesn't work well. I see the popup in a flash, but it gets no focus and dissappears immadiatley. I tried the code with the normal version and it works fine.

I read: https://toolset.com/forums/topic/display-content-in-a-popup/

Thanks,

Marijke

#488470

Nigel
Supporter

Languages: Englisch (English ) Spanisch (Español )

Timezone: Europe/London (GMT+01:00)

Hi Marijke

Can you tell me how and where you are adding the Bootstrap modals to your site?

I just added a modal to a test site with Layouts 1.9 beta 4 using the Toolset starter theme and it displayed and functioned as normal.

If you can give me the details of how you are using it I can try to reproduce the problem, thanks.

#488501

Hi Nigel,

Thank you for your reply. I did a clean local install with the classifieds example to be sure it was not something in my code or my plugins. The code below works nice with the normal versions. I installed the beta plugins. With my first try the button still worked like it should. But after I tried to change something in the view and saved it I got the same problem like my test site.

So I think it must be possible for you to reproduce the problem. Or it would be because I am testing locally? But one would expect that the normal versions wouldn't work either.

I use this code:

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
	<wpv-loop>
       <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#[wpv-post-id]">Open Modal</button>
 
  <div class="modal fade" id="[wpv-post-id]" role="dialog">
 
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
 
          <button type="button" class="close" data-dismiss="modal">×</button>
 
          <h4 class="modal-title">Modal Title</h4>
 
        </div>
 
        <div class="modal-body">
        This is a modal test
        </div>
 
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
 
      </div> 
    </div>
  </div>
		[wpv-post-title]
	</wpv-loop>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]
#488566

Nigel
Supporter

Languages: Englisch (English ) Spanisch (Español )

Timezone: Europe/London (GMT+01:00)

Hi Marijke

I'm still having problems reproducing the problem, even copying and pasting your code above into a View which I add as a View cell to a Layout.

If you have added this to the Classifieds reference site, where exactly did you add it? And what change did you make to the View that stopped it from working? I'll copy your specific steps.

And on the page where the modals are not working correctly, are there any errors in the browser console?

#488942

Hi Nigel,

Sorry, but I don't want to spend more time on it. I both added it to the single Ad layout in a view cell and to a new page with a shortcode ([wpv-view name="modal-test"]). In both instances I got the failure. But I decided to quit testing the beta. It costs me too much time.

Thanks for your efford in trying to reproduce the error.

Marijke