Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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!
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedThe 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:
if !empty($content):
And at the very bottom add this:
endif;
This will have to do until I figure out the right way to fix this.
Comment #2
reload CreditAttribution: reload commentedThank 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.
Comment #3
merlinofchaos CreditAttribution: merlinofchaos commentedNo, $content is just the content. In that template, $title is the title. They are rendered separately.
Comment #4
merlinofchaos CreditAttribution: merlinofchaos commentedhttp://drupal.org/node/613006 marked as duplicate of this issue.
Comment #5
reload CreditAttribution: reload commentedThank you again merlinofchaos. I grabbed the wrong tpl file.
templates directory much to obvious ;)
Comment #6
merlinofchaos CreditAttribution: merlinofchaos commentedOk, checked a fix into -dev that should take care of this.
Comment #7
blueblade CreditAttribution: blueblade commentedHi merlinofchaos,
I tried but it doesnt seem to work. Can you see if I am doing it right?
Comment #8
uomeds CreditAttribution: uomeds commentedDidn'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.
Comment #9
merlinofchaos CreditAttribution: merlinofchaos commentedYou need to wrap the condition in parentheses:
<?php if (!empty($content)): ?>
...
endif;
Comment #10
uomeds CreditAttribution: uomeds commentedOkay now that worked like a charm. Thanks. :)
Comment #11
blueblade CreditAttribution: blueblade commentedI think it's working for me too now =) many thanks!!
Comment #13
ayalon CreditAttribution: ayalon commentedThis works only for panes without styles/borders. If one uses this code the outer html code f.ex. for the grey borders will still be rendered.
Comment #14
HLopes CreditAttribution: HLopes commentedYou can use the same method if you're using the round corners style, just edit
panels-rounded-corners-box.tpl.php
in panels/styles/corners, so it reads