1

I am trying to make a sub theme based on Bootstrap 3 Drupal theme.

I want to add a modal markup in every page. I can see in the base Bootstrap theme template files, there is a file called modal.tpl.php with corresponding HTML markup but I do not know how to include it into my page. Anyone can help?

  • Do you want every page to open in a modal? Or just some modal content on every page? – Link Swanson Apr 5 '15 at 15:48
  • To be exactly, I want the modal to be showed on all the node except for front page – user3448456 Apr 5 '15 at 15:50
1

First refer to the bootstrap documentation on modals http://getbootstrap.com/javascript/ to construct a working modal with the content you want. Use bootply or whatever to get it working the way you want.

You then have two options that come to mind: You could just create a standard block using the Drupal UI, place the markup in the body of the block, and configure the block to "display on every page except" ... <front>. Then assign the block to a region.

Alternatively, you can override tpl files in your subtheme and place the modal markup in those. You do this by placing a copy of the Bootstrap theme's page.tpl.php in your subtheme. First create a copy of it called page--front.tpl.php then add your modal markup to page.tpl.php.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.