I've been trying for months on and off trying to get my block theme to work. I've read the readme, viewed the MustardSeed video, and other issues here but to know avail. I tried the $blocktheme approach but it got too confusing so I've abandoned it and just gone with the blocktheme-XXX.tpl.php technique.
As per the readme, I have created the block theme in the block theme configuration menu. The base block theme is from Zen 6x.1.0, it is below, it's different from what is shown in the video.
The block I am trying to style is placed in the footer region of my Zen subtheme which contains links from "Footer Links" menu.
Other issues I've studied include:
http://drupal.org/node/368192
http://drupal.org/node/279078 --> when I tried the $blocktheme approach
http://drupal.org/node/283489
http://drupal.org/node/309466
http://drupal.org/node/390974
_______________________________
// $Id: block.tpl.php,v 1.4 2008/09/14 12:41:20 johnalbin Exp $
/**
* @file block.tpl.php
*
* Theme implementation to display a block.
*
* Available variables:
* - $block->subject: Block title.
* - $block->content: Block content.
* - $block->module: Module that generated the block.
* - $block->delta: This is a numeric id connected to each module.
* - $block->region: The block region embedding the current block.
* - $classes: A set of CSS classes for the DIV wrapping the block.
Possible values are: block-MODULE, region-odd, region-even, odd, even,
region-count-X, and count-X.
*
* Helper variables:
* - $block_zebra: Outputs 'odd' and 'even' dependent on each block region.
* - $zebra: Same output as $block_zebra but independent of any block region.
* - $block_id: Counter dependent on each block region.
* - $id: Same output as $block_id but independent of any block region.
* - $is_front: Flags true when presented in the front page.
* - $logged_in: Flags true when the current user is a logged-in member.
* - $is_admin: Flags true when the current user is an administrator.
*
* @see template_preprocess()
* @see template_preprocess_block()
*/
print $classes; "> if ($block->subject):
print $block->subject;
endif;
print $block->content;
print $edit_links;
_________________________________
I have retitled the theme to "blocktheme-footertheme.tpl.php, I have also added a link to my styles.css (subtheme.css in my case) stylesheet in the header "drupal_add_css($directory .'/sites/all/themes/subtheme/subtheme.css')"
I have made no other changes to "div id.... etc." As it was not instructed in the readme, but was instructed in the video.
_________________________________
// $Id: block.tpl.php,v 1.4 2008/09/14 12:41:20 johnalbin Exp $
/**
* @file block.tpl.php
*
* Theme implementation to display a block.
*
* Available variables:
* - $block->subject: Block title.
* - $block->content: Block content.
* - $block->module: Module that generated the block.
* - $block->delta: This is a numeric id connected to each module.
* - $block->region: The block region embedding the current block.
* - $classes: A set of CSS classes for the DIV wrapping the block.
Possible values are: block-MODULE, region-odd, region-even, odd, even,
region-count-X, and count-X.
*
* Helper variables:
* - $block_zebra: Outputs 'odd' and 'even' dependent on each block region.
* - $zebra: Same output as $block_zebra but independent of any block region.
* - $block_id: Counter dependent on each block region.
* - $id: Same output as $block_id but independent of any block region.
* - $is_front: Flags true when presented in the front page.
* - $logged_in: Flags true when the current user is a logged-in member.
* - $is_admin: Flags true when the current user is an administrator.
*
* @see template_preprocess()
* @see template_preprocess_block()
*/
drupal_add_css($directory .'/sites/all/themes/subtheme/subtheme.css');
print $classes; "> if ($block->subject):
print $block->subject;
endif;
print $block->content;
print $edit_links;
_____________________________________
I've cleared the cache and theme registry. No changes that I've made in the stylesheet have changed. Running Firebug inspection shows the block in question comes up as "class="block-inner"".
What other changes do I have to do? I am very confused because most of the how-to's are using base block.tpl.php code which is different from mine.
Suggestions/code snippets appreciated.
Comments
Comment #1
Stomper commentedSeems some of the CSS code is not displaying properly.
Original Zen block.tpl.php
______________________
_______________________________________
Modified with link to my stylesheet
______________________________________
Comment #2
Stomper commentedIdeas?
Comment #3
amateescu commentedIf you can see the 'block-inner' css class on your block, it means that blocktheme is working, and it uses your custom block template.
What exactly are you trying to do that's not working?
Comment #4
Stomper commentedWell I've been doing simple CSS changes using my stylesheet (I've added stylesheet path to the custom block theme tpl) but the changes don't see to do anything. Do I have to add my block theme name to the default block.tpl.code - block theme is "footerblock" below?
Thanks
Comment #5
amateescu commentedCan you post the html source for the page that's not working? I'm interested mostly in the
<head>..</head>section and the part that contains your block. And also the contents of css file.Comment #6
Stomper commentedWell the block in question is displayed in the footer site-wide. I've included the header from the homepage
Here is the portion where the block should be themed
Which CSS file are looking for? My subtheme CSS? Also, the stylesheet I am applying to the block theme is an external stylesheet which is referenced by drupal_css.
Comment #7
Stomper commentedSuggestions? I've still found no solution.
Comment #8
amateescu commentedI just tested Block Theme with a Zen subtheme and everything is working fine. Note that you should copy the
block.tpl.phptemplate from Zen to your subtheme so your custom block template gets picked up.Also, sorry for the late answer, but css support does not belong to this queue. You should try #drupal or #drupal-support in IRC.