Each DetailView for a record in Sugar often has several subpanels displayed with it, which lists of related records to the current record. For example, on an Accounts record there is a subpanel displaying all of the related Contacts to that Account record. This provides a great view into the all the related records from a single place.
But often times there are several subpanels that have no data on them, and displaying them can take up valuable screen real estate. This forums poster asked if there was a way to eliminate this, and after a bit of hacking I figured out a solution which should work on any Sugar 6.0-6.2 instance. I will warn you this is not in anyways upgrade-safe, but the code changes are pretty minor so hopefully that won’t be too big of a deterent.
The first change is in the include/ListView/ListView.php file, where we need to pass the panel name to the XTemplate form. The changes are below and indicated in the commented section.
You can now go to any DetailView and if the subpanel has no data, it will be collapsed.