Hi:

Has anyone had success with Panels 2 and blocktheme. I have a panels one implementation that works wonderfully with BlockTheme however when I upgrade to Panels 2, the blocktheme settings are completely ignored.

I am likely missing a setting somewhere but wanted to check here.

Thanks

Comments

merlinofchaos’s picture

Status: Active » Fixed

Panels 2 no longer runs things through theme('block') by default, but you can override theme_panels_pane() and set it up so that it does.

amccann’s picture

Thanks for the fast response.

Any tips on how I can figure out how to override theme_panels_pane?

Thanks again.

merlinofchaos’s picture

It's actually quite easy. Here's a snippet I have running on another site for this:

function phptemplate_panels_pane($content, $pane, $display) {
  if (!empty($content->title)) { $content->subject = $content->title; }
  return theme('block', $content);
}
amccann’s picture

Thanks! Works like a charm.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

Igbonine’s picture

I know drupalers will not understand why this is a problem for me but the fact is that i have exactly the above problem but don't know where to put the code snippet.
Will be most grateful if somebody can help me.
Thanks.

anahowa’s picture

Version: 5.x-2.0-beta3 » 6.x-2.0-alpha3

is this code working for panels 6.x-2.0-alpha3 and Block Theme 6.x-1.0-beta1 ??


<?php
function phptemplate_panels_pane($content, $pane, $display) {
  if (!empty($content->title)) { $content->subject = $content->title; }
  return theme('block', $content);
}
?>

thank you

greg.harvey’s picture

Version: 6.x-2.0-alpha3 » 6.x-3.3
Status: Closed (fixed) » Active

Is there any update on this for Panels 3? I'm looking at it now, but if someone already knows the answer it'll save me some time. Naturally, I'll post back if I get there first. =)

greg.harvey’s picture

Strange - looking at the code, the plugins/styles/block.inc file contains a function called theme_panels_block_style_render_pane() which *appears* to theme a block in the normal way on output:

/**
 * Render callback.
 *
 * @ingroup themeable
 */
function theme_panels_block_style_render_pane($content, $pane, $display) {
  if (empty($content->content)) {
    return;
  }

  if (!empty($content->title)) {
    $content->subject = $content->title;
  }

  $content->region = $pane->panel;
  if (!isset($content->module)) {
    $content->module = $content->type;
  }
  if (!isset($content->delta)) {
    $content->delta = $content->subtype;
  }

  return theme('block', $content);
}

But BlockTheme is not working on panel pages, so clearly I'm missing something. Will keep digging. =/

greg.harvey’s picture

Status: Active » Closed (fixed)

Got it! Once you add your content you need to go to the "Style" option on the context menu for that pane and set it to "System block". Then the block.inc plug-in is invoked, the output is treated as a normal block and the BlockTheme module does it's thing.