Closed (fixed)
Project:
Panels
Version:
7.x-3.0-alpha3
Component:
Panel nodes
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
10 Sep 2011 at 22:14 UTC
Updated:
21 Jun 2013 at 11:51 UTC
Hello
I have created a content type with two "body" fields - a main body, and a side-bar body. The side-bar body field may or may not be empty, and the intent is that a site editor may choose to put something in that region or not.
I have created a panel to display the two body regions, however, if the side-bar region is empty, we're left with a blank bar down the side. I'd like to have that region be hidden if there's no content.
I'm wondering if my best approach is to create a .tpl.php file for the panel, and add some logic there?
Thanks in advance!
Comments
Comment #1
merlinofchaos commentedYou need your layout template to be 'responsive' and able to handle that situation.
No current Panels layouts are responsive, so you would need to create your own layout, use the preprocess to set up the logic, and then have the template render appropriately. The techniques to do this are very similar to the techniques many themes use to have sidebars collapse when empty.
Comment #3
andreymaximov commentedRelated issue for flexible layout #2025043: Flexible layout: hide an empty region/row/column if empty .