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

criz’s picture

Try a switch in block.tpl.php with $block->region

________________________
Drupal Austria Association

carlmcdade’s picture

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

nevets’s picture

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

#sidebar-right .block {
Style elements of the block;
}

#sidebar-right .block h2 {
Only style the h2 element in side the blocks;
}

As a specific example we set the background color of the blocks and the font color for the title (h2)

#sidebar-right .block {
background-color:  blue;
}

#sidebar-right .block h2 {
color: white;
}
carlmcdade’s picture

Got with this using the names used in the template.php

<?php if ($block->region != 'left'){?>
<div class="yrbroundbox" style="clear:both;margin-left:1em">
	<div class="yrbtop"><div></div></div>
		<div class="yrbcontent">
<?php }?>		
  <div class="block block-<?php print $block->module; ?>" id="block-<?php print $block->module; ?>-<?php print $block->delta; ?>">
    <h2 class="title"><?php print $block->subject; ?></h2>
    <div class="content"><?php print $block->content; ?></div>
 </div>
 
 <?php if ($block->region != 'left'){?>
 </div><!-- /yrbcontent -->
	<div class="yrbbot"><div></div></div>
</div><!-- /yrbroundbox -->
<?php }?> 

Hiveminds Magazine
http://www.hiveminds.co.uk
for web publishers and community builders