Panes with no values in view show up, after 3.2 upgrade
reload - October 25, 2009 - 19:38
| Project: | Panels |
| Version: | 6.x-3.2 |
| Component: | Panel pages |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Hello,
I am using a couple panel pages that are using the
same view with different args in each pane.
A view is set to not show (404) if there are no values.
I have the panels set to override the title for each pane,
before the latest upgrade to 3.2 the display showed fine.
now all of the panes show the overridden title even if there are no values.
I reverted back to last version to double check and the panes are gone (the ones with no values).
Is this expected behavior? Do I need to find a different way to hide the no value panes?
Thanks!

#1
The temporary workaround for this is the following:
Copy panel-pane.tpl.php into your theme.
Edit your new panel-pane.tpl.php and at the very top, add this:
<?phpif !empty($content):
?>
And at the very bottom add this:
<?phpendif;
?>
This will have to do until I figure out the right way to fix this.
#2
Thank you merlinofchaos. This works when the title is not overridden,
but I suppose there is something in the $content array when title is overridden?
I also tried $content['middle'] with same results.
#3
No, $content is just the content. In that template, $title is the title. They are rendered separately.
#4
http://drupal.org/node/613006 marked as duplicate of this issue.
#5
Thank you again merlinofchaos. I grabbed the wrong tpl file.
templates directory much to obvious ;)
#6
Ok, checked a fix into -dev that should take care of this.
#7
Hi merlinofchaos,
I tried but it doesnt seem to work. Can you see if I am doing it right?
<?php
if !empty($content):
?>
<?php
// $Id: panels-pane.tpl.php,v 1.1.2.1 2009/10/13 21:38:52 merlinofchaos Exp $
/**
* @file panels-pane.tpl.php
* Main panel pane template
*
* Variables available:
* - $pane->type: the content type inside this pane
* - $pane->subtype: The subtype, if applicable. If a view it will be the
* view name; if a node it will be the nid, etc.
* - $title: The title of the content
* - $content: The actual content
* - $links: Any links associated with the content
* - $more: An optional 'more' link (destination only)
* - $admin_links: Administrative links associated with the content
* - $feeds: Any feed icons or associated with the content
* - $display: The complete panels display object containing all kinds of
* data including the contexts and all of the other panes being displayed.
*/
?>
<div class="<?php print $classes; ?>" <?php print $id; ?>>
<?php if ($admin_links): ?>
<div class="admin-links panel-hide">
<?php print $admin_links; ?>
</div>
<?php endif; ?>
<?php if ($title): ?>
<h2 class="pane-title"><?php print $title; ?></h2>
<?php endif; ?>
<?php if ($feeds): ?>
<div class="feed">
<?php print $feeds; ?>
</div>
<?php endif; ?>
<div class="pane-content">
<?php print $content; ?>
</div>
<?php if ($links): ?>
<div class="links">
<?php print $links; ?>
</div>
<?php endif; ?>
<?php if ($more): ?>
<div class="more-link">
<?php print $more; ?>
</div>
<?php endif; ?>
</div>
<?php
endif;
?>
#8
Didn't work for me either. Gave me:
Parse error: syntax error, unexpected '!', expecting '(' in /public_html/sites/all/modules/panels/templates/panels-pane.tpl.php on line 2
I'll try the dev.
#9
You need to wrap the condition in parentheses:
<?php if (!empty($content)): ?>...
<?phpendif;
?>
#10
Okay now that worked like a charm. Thanks. :)
#11
I think it's working for me too now =) many thanks!!
#12
Automatically closed -- issue fixed for 2 weeks with no activity.