Parijat Kalia
Parijat Kalia

Reputation: 5095

Unable to add a new region to sub theme

So I have a Bartik sub-theme that I am using for my website. Now the idea is to add a custom region to this theme. I am following the process described below:

  1. Add custom region to subtheme.info file like : region['custom_region'] = Custom Region
  2. Add to subtheme's page.tpl.php page:

This does not work and the custom region does not appear when I check for it.

I did the same for the Bartik theme (that is the default provided theme) and it works fine, meaning the custom region appears where it ought to be.

So what's fishy here? : p

Thanks guys!

Upvotes: 1

Views: 336

Answers (2)

davidneedham
davidneedham

Reputation: 378

You shouldn't need the apostrophes. Also, you should define the region as "regions" - so try this in your .info file:

regions[custom_region] = Custom Region

Good luck! :-)

Upvotes: 3

Viktor Bogutskii
Viktor Bogutskii

Reputation: 930

In page.tpl.php page insert:

<?php if ($page['custom_region']): ?>
  <div id="custom_region">
    <?php print render($page['custom_region']); ?>
  </div>
<?php endif; ?>

And Flush all caches

Upvotes: 2

Related Questions