I want the blocks on the right side bar to look different from those on the right. I have tried defining different blocks for each region ( such as block-right_sidebar.tpl.php) but it doesn't just work. Does anyone have any ideas ? I am working with bluemarine.

Comments

nevets’s picture

While pages and individual blocks use templates, regions do not. A starting place is to use css to style the blocks. Generally a region in page.tpl.php has a surrounding div with id (or class). You can use the id to apply css to only blocks in that region.

electronicmonkey’s picture

Sorry not too clear. I am using bluemarine (in Drupal 5) and the sidebar is typically declared as

<?php if ($sidebar_right) { ?><td id="sidebar-right">
      <?php print $sidebar_right ?>
    </td><?php } ?> 

And the block as

  <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>

If I want a different type of block for the right sidebar what do I add to this or to the filename?

nevets’s picture

To style the blocks with css you would want to start your css selector with td.sidebar-right .block so for example to make all the titles red you could add the following to the end of your themes style.css file.

td.sidebar-right .block .title {
  color: red;
}

Not sure what you mean by "a different type of block"

electronicmonkey’s picture

Good thanks for requesting. As it is I have used photoframe module to give the blocks rounded corners . The coding:

<div class="photoframe-slimround-with-white-background">
<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>
</div>

However I want the blocks on the right sidebar to have plain square corners different from elsewhere

nevets’s picture

I am guessing that is your block.tpl.php. I would replace <div class="photoframe-slimround-with-white-background"> with <div class="photoframe "> and then in your css replace photoframe-slimround-with-white-background with just photoframe. Then to change/remove the frame from the one region use something like

td.sidebar-right .photoframe {
  background: none;
}

This rule needs to be after any general rule for photoframe.

electronicmonkey’s picture

I am afraid that is how it should be written to make the output come as rounded corner . I thought of naming this block.tpl and the creating another block-sidebar_right.tpl without the <div class="photoframe-slimround-with-white-background"> but nothing changed . Curiously a block-content.tpl works just how I want it - no rounded corners.

electronicmonkey’s picture

Simple solution after all. Remove <div class="photoframe-slimround-with-white-background"> from block.tpl and style every block separately.