0

I need to have my block title for Newsletter Signup block appear like this:

Sign up for mail

Note: Sign up = red colored font for mail = blue colored font

Please help, I know how to override a block.tpl.php file, but I am not sure what my code would be to separate the word groups and add a div or span.

1 Answer 1

0

Quick and dirty in your block.tpl.php:

<?php
  if ($block->subject=='Sign up for mail') {
    $block->subject='<span class="red">Sign up</span> <span class="blue">for mail</span>';
  }
?>

And in your .css file:

.blue {
   color: blue;
}

.red {
    color: red;
}
2
  • Would this go in my general block.tpl.php file or in a specific one for that block? block.tpl.php right now show: <?php if ($block->subject): ?> <div class="title-wrapper-theme"> <h2 class="title block-title"><?php print $block->subject ?></h2>
    – Zachary
    Nov 29, 2011 at 20:57
  • Works! Put it in the specific block template, see here drupal.org/node/104319
    – Zachary
    Nov 29, 2011 at 21:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.