Support Center

How to add three new inline Drupal regions under the Promoted area region

Last Updated: Jun 25, 2013 10:04PM EEST


Drupal Premium and Responsive TopHit theme comes with a wealth of custom regions: Header top, Header, Header right, Navigation, Banner, Highlighted, Promoted area, Custom front area, Footer first, Footer second and Footer third.

In addition, TopHit comes with the following ready-made for your ease view blocks: Latest products, Products in use, Promoted posts, Slideshow & Testimonials. Have always in your mind that TopHit product is fully documented on our wiki pages.

On its front-page and exactly under the Highlighted message, you can see the Promoted posts view (3-columns view) which is placed into the Promoted area region. Often, we receive the question "How to place three simple blocks or view blocks into the Promoted area region instead of the existing Promoted posts view?". The simplest way to do this is just to create three new inline Drupal regions under the Promoted area region. After this, if you don't need the Promoted posts view, just disable this view block through Home » Administration » Structure » Blocks.

In order to add three new inline Drupal regions under the Promoted area region, just follow these steps:

1. Add the new Drupal regions 

Edit your tophit.info file and exactly under the entry regions[promoted] = Promoted area, define the new regions:
 
.
.
.
regions[promoted_left] = Promoted left area
regions[promoted_center] = Promoted center area
regions[promoted_right] = Promoted right area
.
.
.


2. Clear all cached data

After this you should clear all cached data through Drupal’s User interface Home » Administration » Configuration » Performance. This step is important in order to force your template to be informed for the changes you have made in the template files.

3. Print inline the three new Drupal regions

Edit your page.tpl.php template file (sites/all/themes/tophit/page.tpl.php) and exactly under the Promoted area region:
 
<!-- #promoted -->
<?php if ($page['promoted']):?>
<div id="promoted" class="clearfix">
<?php print render($page['promoted']); ?>
</div>
<?php endif; ?>
<!-- EOF: #promoted -->

print the new regions with the following code:
 
<?php if ($page['promoted_left']):?>
<div class="one-third column">
<!-- #promoted-left -->
<div id="promoted-left" class="mt-column-fix">
<?php print render($page['promoted_left']); ?>
</div>
<!-- EOF: #promoted-left -->
</div>
<?php endif; ?>

<?php if ($page['promoted_center']):?>
<div class="one-third column">
<!-- #promoted-center -->
<div id="promoted-second" class="mt-column-fix">
<?php print render($page['promoted_center']); ?>
</div>
<!-- EOF: #promoted-center -->
</div>
<?php endif; ?>

<?php if ($page['promoted_right']):?>
<div class="one-third column">
<!-- #promoted-third -->
<div id="promoted-third" class="mt-column-fix">
<?php print render($page['promoted_right']); ?>
</div>
<!-- EOF: #promoted-right -->
</div>
<?php endif; ?>

4. Finally, Place your blocks inside the corresponding regions

Finally and after the above changes, you will be able to place your blocks to the corresponding regions through Home » Administration » Structure » Blocks

In case this article leaves any of your questions or concerns unanswered, please feel welcome to email us or post a public question.

​More than (just) Themes
http://www.morethanthemes.com/

Contact Us

support-agent@morethanthemes.com
http://assets2.desk.com/
false
morethanthemes
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete