Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

Using Context 3.x and Zen 2.x together

Parent Feed: 

If you're using Context module in your site, and Zen as your base theme, when you upgrade to Context 3, your site will probably broke, this can be fixed quickly by editing your template.php and add this code in your hook_blocks:

<?php
function <THEMENAME>_blocks($region, $show_blocks = NULL) {
    if (
module_exists("context")){
    
     
// Since Drupal 6 doesn't pass $show_blocks to theme_blocks, we manually call
      // theme('blocks', NULL, $show_blocks) so that this function can remember the
      // value on later calls.
     
static $render_sidebars = TRUE;
      if (!
is_null($show_blocks)) {
       
$render_sidebars = $show_blocks;
      }
    
     
// Bail if this region is disabled.
      //$disabled_regions = context_active_values('theme_regiontoggle');
      //if (!empty($disabled_regions) && in_array($region, $disabled_regions)) {
        //return '';
      //}      // If zen_blocks was called with a NULL region, its likely we were just
      // setting the $render_sidebars static variable.
     
if ($region) {
       
$output = '';        $plugin = context_get_plugin('reaction', 'block');
  
       
// Add any content assigned to this region through drupal_set_content() calls.
       
$output .= $plugin->execute($region);
  
       
$elements['#children'] = $output;
       
$elements['#region'] = $region;
  
        return
$output ? theme('region', $elements) : '';
      }
    }
    else {
        return
zen_blocks($region, $show_blocks);
    }
}
?>
Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web