Hi there,

Is there a way to work out from the "render panel" callback which panel is being rendered? I have the $panel_id argument, but this is always set to NULL: -

<?php
/**
* Implementation of hook_panels_styles().
*/
function firstutility_fu_panels_styles() {
  return array(
    'fu' => array(
      'title'		=> t('First Utility'),
      'description'	=> t('White, Grey or Blue panels'),
      'render panel'	=> 'firstutility_fu_style_panel',
      'render pane'  => 'firstutility_fu_style_pane',
      'settings form'	=> 'firstutility_fu_form',
      'hook theme'	=> array(
        'fu' => array(
          'template' => 'fu_template',
          'path' => drupal_get_path('theme', 'firstutility') .'/panels/styles/fu',
          'arguments' => array(
            'content' => NULL,
          ),
        ),
      ),
    ),
  );
}

function theme_firstutility_fu_style_panel($display, $panel_id, $panes, $settings){
	$content = new stdClass;
	$content->settings = array();
	$content->settings['background_color'] = $settings['background_color'] ? $settings['background_color'] : 'white';
	$content->settings['panel_id'] = $panel_id; // Currently always NULL
	foreach($panes as $pane_id => $data) {
		$content->content .= panels_render_pane($data, $display->content[$pane_id], $display);
	}
	return theme('fu', $content);
}

Is this supposed to be the case, and if so, if there a function to find out which panel we're rendering?

Thanks,

Dubs

Comments

Letharion’s picture

Assigned: Unassigned » merlinofchaos

I don't know, @merlin?

japerry’s picture

Status: Active » Closed (outdated)

Closing this issue as outdated as Drupal 6 ctools is not supported. If this issue is relevant for Drupal 7, feel free to re-open and mark for Drupal 7 (or 8)