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
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

merlinofchaos - October 26, 2009 - 05:46

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:

<?php
if !empty($content):
?>

And at the very bottom add this:

<?php
endif;
?>

This will have to do until I figure out the right way to fix this.

#2

reload - October 26, 2009 - 07:22

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

merlinofchaos - October 26, 2009 - 17:07

No, $content is just the content. In that template, $title is the title. They are rendered separately.

#4

merlinofchaos - October 26, 2009 - 17:11

http://drupal.org/node/613006 marked as duplicate of this issue.

#5

reload - October 27, 2009 - 05:47

Thank you again merlinofchaos. I grabbed the wrong tpl file.
templates directory much to obvious ;)

#6

merlinofchaos - October 27, 2009 - 22:56
Status:active» fixed

Ok, checked a fix into -dev that should take care of this.

#7

blueblade - November 10, 2009 - 00:25

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

uomeds - November 12, 2009 - 01:54

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

merlinofchaos - November 12, 2009 - 02:47

You need to wrap the condition in parentheses:

<?php if (!empty($content)): ?>
...

<?php
endif;
?>

#10

uomeds - November 12, 2009 - 03:10

Okay now that worked like a charm. Thanks. :)

#11

blueblade - November 13, 2009 - 02:05

I think it's working for me too now =) many thanks!!

#12

System Message - November 27, 2009 - 02:10
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.