Why it does not work?
hopfrog - July 1, 2008 - 06:05
| Project: | Block Theme |
| Version: | 5.x-1.2 |
| Component: | User interface |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
It excuses but really I do not succeed to resolve this problem!
1. In style.css I put:
/* block theme styles */
.blocco01 { background: #F2F0CF; }
.blocco01 h2 { color: #8D1019; }
.blocco01 a { color: #8D1019; }
.blocco02 { background:#8D1019; color:#fff; }
.blocco02 h2 { color:#F2F0CF; }
.blocco02 a { color: #F2F0CF; }
.blocco03 { background:#001F46; color:#F2F0CF; }
.blocco03 h2 { color:#F2F0CF; }
.blocco03 a { color: #fff; }
.blocco04 { background: #F2F0CF; color: #1D2326; }
.blocco04 h2 { background: #886A2E; border-top: 1px solid #561A25; border-bottom: 1px solid #561A25; color: #F2F0CF; }
.blocco04 a { color: #8D1019; }
.blocco05 { background: #8D1019; color: #F2F0CF; }
.blocco05 h2 { background: #001F46; border-top: 1px solid #886A2E; border-bottom: 1px solid #886A2E; color: #F2F0CF; }
.blocco05 a { color: #fff; }
.blocco06 { background: #001F46; color: #F2F0CF; }
.blocco06 h2 { background: #8D1019; border-top: 1px solid #886A2E; border-bottom: 1px solid #886A2E; color: #F2F0CF; }
.blocco06 a { color: #fff; }
.blocco07 { border: 1px solid #8D1019; }
.blocco07 h2, .blocco07 a { color: #8D1019; }
.blocco08 { border: 1px solid #001F46; }
.blocco08 h2, .blocco08 a { color: #001F46; }
.blocco09 { background: #8D1019; color:#F2F0CF; }
.blocco09 a { color:#fff; }
.blocco10 { background: #001F46; color:#F2F0CF; }
.blocco10 a { color:#fff; }2. I created 10 file blocco01, blocco02... blocco10.tpl.php and introduced to the inside of the directory of the subject
3. in blocco01.tpl.php I put:
<div class="block block-<?php print $block->module; ?>" id="block-<?php print $block->module; ?> blocco01 ">
<h2 class="title"><?php print $block->subject; ?> </h2>
<h4 class="content"><?php print $block->content; ?> </h4>
</div>to make to recall the template from style. css
4. In setting-->Block Theme i put:
blocco01|Verde
blocco02|Arancio
blocco03|Giallo
blocco04|Azzurro
blocco05|Viola-blu
blocco06|Viola-Blu
blocco07|aa
blocco08|ss
blocco09|dd
blocco10|ffWhy it does not work?
I am secure that it I am discussed of a mistake of mine but where mistake?

#1
Toc, toc. There it is someone?
#2
Hi,
In your code you did the following:
id="block-<?php print $block->module; ?> blocco01 "Which adds the class name to the id attribute. Instead, you should add your class name to the class attribute:
<div class="block block-<?php print $block->module; ?> blocco01 " id="block-<?php print $block->module; ?>"><h2 class="title"><?php print $block->subject; ?> </h2>
<h4 class="content"><?php print $block->content; ?> </h4>
</div>
Gertjan
#3
Thanks for the reply. I experienced this solution and I copied exactly this, but does not work. I do not understand actual the reason! I should indicate the specific block? ?( example: id="block-50)
But this way it has not had sense! Correctly?
I use Salamander and in template. php also I introduced this:
// BlockTheme
function salamander_block($block) {
if (module_exists('blocktheme')) {
if ( $custom_theme = blocktheme_get_theme($block) ) {
return _phptemplate_callback('block',array('block' => $block),array($custom_theme) );
}
}
return phptemplate_block($block);
}
Really I do not understand what it does not go! Some other advice? Thanks
#4
I understand your confusion about the id attribute. I didn't notice that the $block-delta was missing in your id attribute. It should be there to make your block-id's unique:
<div class="block block-<?php print $block->module; ?> blocco01 " id="block-<?php print $block->module .'-'. $block->delta; ?>"><h2 class="title"><?php print $block->subject; ?> </h2>
<h4 class="content"><?php print $block->content; ?> </h4>
</div>
This, however doesn't explain why your blocks don't show. I'm trying to replicate this, but without succes.
Are you by any chance using Drupal 6?
Gertjan
#5
No. I use 5.6
I experience to install all from the start and then I communicate the result