I would like to use some css to change individual blocks. However using firebug, all of my blocks have a div id of defaultblock. how can i assign ids to specific blocks so that i can then add css?
I am using the marinelli theme.

Comments

nevets’s picture

I would look at the themes block.tpl.php file, Garlands file looks like

<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="clear-block block block-<?php print $block->module ?>">

<?php if (!empty($block->subject)): ?>
  <h2><?php print $block->subject ?></h2>
<?php endif;?>

  <div class="content"><?php print $block->content ?></div>
</div>

and you can see how the set both id and class.

calebm12’s picture

the marinelli block.tpl.php file is this

 <div class="defaultblock">
    <h2><?php print $block->subject; ?></h2><!--block title-->
   <div class="blockcontent"><?php print $block->content; ?></div>
</div>

do i just subsitute in the garland coding?

nevets’s picture

<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="defaultblock">
    <h2><?php print $block->subject; ?></h2><!--block title-->
   <div class="blockcontent"><?php print $block->content; ?></div>
</div>

this way existing theming for blocks will continue to work.
You could also try this for the first div

<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="defaultblock clear-block block block-<?php print $block->module ?>">
calebm12’s picture

that works great. thanks

vr_mex’s picture

This code should be part of the main Marinelli, this would solve the issue !!!