Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By carlmcdade on
I have hunted around for this and found nothing that goes specifically to the task. If you have three regions can you have a block.tpl.php for each or have a switch in a single block.tpl.php that detects which region the block is being rendered in?
Comments
Try a switch in
Try a switch in block.tpl.php with $block->region
________________________
Drupal Austria Association
What is the content of $block->region?
What name, string or id am I looking for when I use this?
Hiveminds Magazine
http://www.hiveminds.co.uk
for web publishers and community builders
Generally regions have and id and/or class
Generally regions have some html markup (ex: a div) with an id and/or class that "wraps" the contents of the region. On this site for example the right hande blocks are in a region with the id #sidebar-right. All blocks have an id specific to the block, a class specific to the module and a general class of 'block'. So given an id/class for the region and the geneal class of 'block' for blocks you can do things like
As a specific example we set the background color of the blocks and the font color for the title (h2)
Got with this using the
Got with this using the names used in the template.php
Hiveminds Magazine
http://www.hiveminds.co.uk
for web publishers and community builders