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 $block->module . '-' . $block->delta; " class=" 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 $block->module . '-' . $block->delta; " class=" 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

Stomper’s picture

Seems some of the CSS code is not displaying properly.
Original Zen block.tpl.php
______________________

<?php
// $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()
 */

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

  <?php if ($block->subject): ?>
    <h2 class="title"><?php print $block->subject; ?></h2>
  <?php endif; ?>

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

  <?php print $edit_links; ?>

</div></div> <!-- /block-inner, /block -->


_______________________________________
Modified with link to my stylesheet

______________________________________


<?php
// $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');

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

  <?php if ($block->subject): ?>
    <h2 class="title"><?php print $block->subject; ?></h2>
  <?php endif; ?>

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

  <?php print $edit_links; ?>

</div></div> <!-- /block-inner, /block -->

Stomper’s picture

Ideas?

amateescu’s picture

Status: Active » Postponed (maintainer needs more info)

If 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?

Stomper’s picture

Well 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?

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

Thanks

amateescu’s picture

Can 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.

Stomper’s picture

Well the block in question is displayed in the footer site-wide. I've included the header from the homepage

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title> Big Bob's Beepers</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://website.com/blogapi/rsd" />
<link rel="shortcut icon" href="/sites/all/themes/subtheme/favicon.ico" type="image/x-icon" />
  <link type="text/css" rel="stylesheet" media="all" href="/modules/node/node.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/defaults.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/system.css?M" />

<link type="text/css" rel="stylesheet" media="all" href="/modules/system/system-menus.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/user/user.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/cck/theme/content-module.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/ctools/css/ctools.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/date/date.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/filefield/filefield.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/fivestar/css/fivestar.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/logintoboggan/logintoboggan.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/og/theme/og.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/panels/css/panels.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/ubercart/shipping/uc_quote/uc_quote.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/ubercart/shipping/uc_ups/uc_ups.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/ubercart/uc_order/uc_order.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/ubercart/uc_product/uc_product.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/ubercart/uc_roles/uc_roles.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/ubercart/uc_store/uc_store.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/user_relationships/user_relationships_ui/user_relationships_ui.css?M" />

<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/views_slideshow/contrib/views_slideshow_singleframe/views_slideshow.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/forum/forum.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/cck/modules/fieldgroup/fieldgroup.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/views/css/views.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/subtheme/layouts/frontpage/frontpage.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/custom_search/custom_search.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/subtheme/html-elements.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/zen/zen/tabs.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/zen/zen/messages.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/zen/zen/block-editing.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/zen/zen/wireframes.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/subtheme/layout.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/subtheme/subtheme.css?M" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/subtheme/subtheme-fresh.css?M" />
<link type="text/css" rel="stylesheet" media="print" href="/sites/all/themes/subtheme/print.css?M" />
<!--[if IE]>
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/zen/zen/ie.css?M" />
<![endif]-->
  <script type="text/javascript" src="/misc/jquery.js?M"></script>

<script type="text/javascript" src="/misc/drupal.js?M"></script>
<script type="text/javascript" src="/sites/all/modules/fivestar/js/fivestar.js?M"></script>
<script type="text/javascript" src="/sites/all/modules/og/og.js?M"></script>
<script type="text/javascript" src="/sites/all/modules/panels/js/panels.js?M"></script>
<script type="text/javascript" src="/sites/all/modules/poormanscron/poormanscron.js?M"></script>
<script type="text/javascript" src="/sites/all/modules/ubercart/uc_roles/uc_roles.js?M"></script>
<script type="text/javascript" src="/sites/all/modules/user_relationships/user_relationships_ui/user_relationships_ui.js?M"></script>
<script type="text/javascript" src="/sites/all/modules/views_slideshow/js/jquery.cycle.all.min.js?M"></script>
<script type="text/javascript" src="/sites/all/modules/views_slideshow/contrib/views_slideshow_singleframe/views_slideshow.js?M"></script>

<script type="text/javascript" src="/sites/all/modules/custom_search/custom_search.js?M"></script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, { "basePath": "/", "fivestar": { "titleUser": "Your rating: ", "titleAverage": "Average: ", "feedbackSavingVote": "Saving your vote...", "feedbackVoteSaved": "Your vote has been saved.", "feedbackDeletingVote": "Deleting your vote...", "feedbackVoteDeleted": "Your vote has been deleted." }, "cron": { "basePath": "/poormanscron", "runNext": 1305237306 }, "user_relationships_ui": { "loadingimage": "/sites/all/modules/user_relationships/user_relationships_ui/images/loadingAnimation.gif", "savingimage": "/sites/all/modules/user_relationships/user_relationships_ui/images/savingimage.gif", "position": { "position": "absolute", "left": "0", "top": "0" } }, "custom_search": { "form_target": "_self", "solr": 0 }, "viewsSlideshowSingleFrame": { "#views_slideshow_singleframe_main_community_slideshow-panel_pane_1": { "num_divs": 4, "id_prefix": "#views_slideshow_singleframe_main_", "div_prefix": "#views_slideshow_singleframe_div_", "vss_id": "community_slideshow-panel_pane_1", "timeout": "5000", "sort": 1, "effect": "fade", "speed": "1000", "start_paused": 0, "delay": "0", "fixed_height": "1", "random": "0", "pause": "1", "pause_on_click": "0", "pause_when_hidden": 0, "pause_when_hidden_type": "full", "amount_allowed_visible": "", "remember_slide": 0, "remember_slide_days": "1", "controls": "0", "items_per_slide": "5", "pager": "0", "pager_type": "Numbered", "pager_hover": "2", "pager_click_to_page": 0, "image_count": "0", "nowrap": "0", "sync": "1", "advanced": "", "ie": { "cleartype": "true", "cleartypenobg": "false" } } } });
//--><!]]>
</script>
</head>

Here is the portion where the block should be themed

<div id="footer"><div id="footer-inner" class="region region-footer">

                  <div id="footer-message"> Copyright 2011</div>
        
        <div id="block-menu-menu-footer-links" class="block block-menu region-odd odd region-count-1 count-1"><div class="block-inner">

  
  <div class="content">

<ul class="menu">
<li class="leaf first"><a href="/help" title="Tutorials and guides"> Help and How To</a></li>
<li class="leaf"><a href="/advertising" title="Advertising opportunities ">Advertising </a></li>
<li class="leaf"><a href="/contactus" title="Have questions?">Contact Us</a></li>
<li class="leaf"><a href="/careers" title="Find and apply for employment">Jobs and Careers</a></li>
<li class="leaf"><a href="/privacy" title="privacy statement">Privacy</a></li>
<li class="leaf"><a href="/legal" title="">Terms of Use</a></li>
<li class="leaf last"><a href="/corporate" title="Learn more the company">The Company</a></li>
</ul>  </div>

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.

Stomper’s picture

Suggestions? I've still found no solution.

amateescu’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

I just tested Block Theme with a Zen subtheme and everything is working fine. Note that you should copy the block.tpl.php template 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.