Sarkari Naukri and Naukri

Thursday, 4 April 2013

Create New Block Region in Drupal 7

Step 1:
Open up your theme's .info file and add the following line:
regions[new_region] = New Region

Step 2:
Now go to the your site url/admin/structure/block and select which block you want to show in your newly create region, and save the your choice.


Step 3:
Then you'll need to print out your new region in your page.tpl.php file which goes something like this now:
<?php if ($page['new_region']): ?>
      <div id="new_region"><div>
        <?php print render($page['new_region']); ?>
      </div></div>
    <?php endif; ?>

No comments:

Post a Comment