Panel Styles
where can i find some documentation about how to create a new "Panel Styles" ?
i tried do that using the functions below in a file called: window.inc inside modules/panel/styles.
But, nothing happen. I also tried remove $output = theme('panels_pane', $content, $pane, $display); to see something wrong happen, but nothing.
function panels_window_panels_styles() {
return array(
'window' => array(
'title' => t('Window'),
'description' => t('Create a window style'),
'render pane' => 'panels_window_style_render_pane',
),
);
}
function theme_panels_window_style_render_pane($content, $pane, $display) {
$output = theme('panels_pane', $content, $pane, $display);
if (!$output) {
return;
}
return render_window_box($content);
}
function render_window_box($content)
{
return <<< EOF
<div class="window">
$content
</div>
EOF;
}Groups:
Login to post comments
I suspect you have to
I suspect you have to register your styles inside a module.
Dave
pass $output instead
@Dwees, as long as window.inc is in that folder, it shows up in the UI, I can select it on a pane (being the blocks/views/boxes that go inside each panel in a display). To get this to work on the panels, you'd have to change the line to something like:
'render panel' => 'panels_window_style_render_panel',
@teglia - the problem is that you're passing $content, which appears to be an object, not a string. Try passing the $output to your function:
render_window_box($output)
Before I can get anything to show up, I have to "flush all caches" in my Admin Menu (I imagine truncating a few DB tables would do the same trick). I got this to work on my install with the latest alpha of panels (6.x-3.0-alpha4).
Ryan Price
Florida Creatives
Check out
Check out http://drupal.org/node/427192 where an example has been posted to the queue. Reviewing this documentation and example could be very helpful in terms of getting it integrated into the official documentation.