1

I am using bootstrap theme. I have 4 blocks: block1, block2, block3, block4. Bootstrap has 12 columns grid. I would like to place block 1 in first 7 columns(using bootstrap class "col-md-7"). I would like to place block 2,3,and 4 to the right of the block 1. Can you please advise how to achieve it?

enter image description here

  • 1
    Please mention the Drupal version, this would help other members to provider better answer. – Yogesh Jan 2 '17 at 5:02
  • Drupal Version: 7. – learn4ever Jan 2 '17 at 19:01
2

This approach might suit your case.

Create 2 new regions in your template info file and render them in your page.tpl.php

If you are using a bootstrap subtheme, this file will be located in siites/all/themes/bootstrap/templates/system so you will have to copy it and put in your templates folder under you subtheme folder. Remember to clear the Theme Registry cache after this.

So I would do this like below

info file

regions[main_block] = 'Main Block Region'
regions[side_block] = 'Side Block Region'

page.tpl.php file

<div class="row">
  <div class="col-md-7">
    <?php print render($page['main_block']); ?>
  </div>
  <div class="col-md-5">
    <?php print render($page['side_block']); ?>
  </div> 
</div>

After go to the blocks admin interface and select the blocks to show on the correct region. Also for the Side Blocks render all three blocks you need in the Side Block Region and use the correct weights to sort them as you like.

0

You need to override/create tpl files depends on your situation. After that use the Bootstarp class you need to use.

See bootstrap_subtheme/templates/README.txt.

You should put those files in yourtheme/templates/ (no sub-folder) and a quick cache clear after that.

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.