Where to add 'superblock' ...
Liliplanet - December 7, 2008 - 10:21
| Project: | Block Theme |
| Version: | 6.x-1.0-beta1 |
| Component: | Documentation |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hi,
I've duplicated my block.tpl..php to the following, but where do I add 'superblock' please?
superblock|My SuperTemplate in the block theme config.
<?php // $Id: block.tpl.php,v 1.3 2008/09/09 13:14:22 jmburnz Exp $
/**
* @file
* block.tpl.php
*
* Theme implementation to display a block.
*
* @see template_preprocess()
* @see template_preprocess_block()
*/
?>
<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="block <?php print $block_classes; ?>">
<div class="block-inner">
<?php if (!empty($block->subject)): ?>
<h2 class="block-title"><?php print $block->subject; ?></h2>
<?php endif; ?>
<div class="block-content">
<div class="block-content-inner">
<?php print $block->content; ?>
</div>
</div>
</div>
</div> <!-- /block -->My .css is as follows:
.block h2.block-title {
color: #FFF;
font-size: 12px;
font-weight: bold;
height: 22px;
margin: 0px;
padding: 5px 0 0 0;
text-align: center;
}
.superblock h2.block-title {
color: #000000;
font-size: 12px;
font-weight: bold;
height: 22px;
margin: 0px;
padding: 5px 0 0 0;
text-align: center;
}Would most appreciate your help, and thank you.
Lilian

#1
Hello Lillian.
If I understand you question correctly you want to style your superblock with the superblock class you have defined.
This is quite simple - you just add the class definition to the outer div:
Before:
<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="block <?php print $block_classes; ?> ">After:
<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="block <?php print $block_classes; ?> superblock">This should do the trick - the superblock css will override the styles defined in the block css.
I hope it helps you out.
#2
Thank you Dragone for your reply.
I've changed to
<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="block <?php print $block_classes; ?> superblock">to my template called blocktheme-superblock.tpl.php
in the css have
.block h2.block-title {
color: #FFF;
font-size: 12px;
font-weight: bold;
height: 22px;
margin: 0px;
padding: 5px 0 0 0;
text-align: center;
}
.superblock h2.block-title {
color: #000000;
font-size: 12px;
font-weight: bold;
height: 22px;
margin: 0px;
padding: 5px 0 0 0;
text-align: center;
}
still no change in other words the title does not change to #000000 on the selected block.
Probably missing something small, yet cannot see where .. :)
Most appreciate your help.
Lilian
#3
first off, why are u using Block Theme, when u can just do either of the following:
1. block-module-delta.tpl.php
2. block-module.tpl.php
3. block-region.tpl.php
now lets have a look at your css, it seems to work quite nicely for me, i have reproduced it, not in a drupal environment tho, perhaps there is a css clash, change the css class name.
#4
Thank you for your reply. Yes, I would like to use Block Theme as categorizing blocks for user, news, friends, etc. Block Theme is easier that way.
Have now renamed in Block Theme:
redblock|My SuperTemplate
.redblock h2.block-title {
color: #000000;
font-size: 12px;
font-weight: bold;
height: 22px;
margin: 0px;
padding: 5px 0 0 0;
text-align: center;
}
renamed: blocktheme-redblock.tpl.php
and still no change .. (:
any ideas please?
Lilian
#5
I've added the :
.redblock h2.block-title {
color: #000000;
font-size: 12px;
font-weight: bold;
height: 22px;
margin: 0px;
padding: 5px 0 0 0;
text-align: center;
}
to my theme style.css file. Is that where should it be, or should it be in modules/system/defaults.css?
so close ..
Thank you for any reply.
Lilian