What is the best way to use bootstrap modal with drupal?

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
vitkuz's picture

Hi!

Thanks for you work!

I'd like to know what is the best way to use bootstrap modals with druapl. I want to show "Login form" and Status Massages in modal.

My basic (dummie?) aproach:

1) I create html and paste it at the bottom in page.tpl.
2) I create link that trigers modal widow and paste it in block.

It worked! But I feel like the is much better aproach?

Thanks!

Comments

Greetings, I haven't

pyxio's picture

Greetings,

I haven't personally attempted to implement a bootstrap modal yet... however, zenstrap theme http://drupal.org/project/zenstrap has this functionality integrated. I have used the theme in the past and it is a good theme. Give it a shot. Cheers Kevin

Also, if you don't want to

pyxio's picture

Also, if you don't want to use the theme zenstrap you might be able to find out how they do it by examining the code. Let us know how you solve it. Good luck.

Thanks! It helped.

vitkuz's picture

Thanks! It helped.

I like to have a block region

duncan.moo's picture

I like to have a block region for modals and make sure that it has fallback styling and displays if JS is disabled.

For the blocks I then edited the template files so that I could make use of Bootstrap's modal-header, -body and -footer classes, it worked well.