When trying to use the Bootsrap modal in a block it fails to display correctly. It kinda displays the modal but it is still in a "fade in" mode and then you are unable to close the modal - the only way to exit is by refreshing the browser.
I used this sample code from the getbootstrap.com site right in a block. It seems like navbar might be causing this to happen
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Launch demo modal
</button>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
Comments
Comment #2
blamege1 commentedI was having the same issue. Not sure if this helps, but I created a block view for the modal. Then I created a new region below the footer called Portfolio Modal and placed the block in that that region. So the Modal doesn't actually sit inside any of the other sections such as Content for example. It sits in it's own region. Like this
Comment #3
wavesailor commentedComment #4
wavesailor commented@blamege1 that worked - thanks
Some more detailed help for others:
Create a new region in file
bootstrap_agency.infolike this:regions[portfolioModal] = 'Portfolio modal'Add the region to the bottom of
page.tpl.phpfile as mentioned in #2<?php print render($page['portfolioModal']); ?>You then add your
buttonor<a>trigger code to the block where you want to display it i.e.Finally you add a new block (or block view) to the portfolioModal region which will contain your "modal code" i.e.
Comment #5
blamege1 commentedNo problem @wavesailor. Glad I could help.
Comment #6
jcnventura