I was alerted to this post in the forums the other day, where the poster was looking to find out how to bring that nice little ‘More Info’ icon to their subpanels. For those less familar, from what I am referring to, see this screen capture of it in action.
This come by default for all listviews, and provides a nice way to get a quick peek at record’s content. It’s also very customizable, as shown in this blog post by Sugar Community member and developer for Sugar Gold partner Profiling Solutions Matthew Poer. But doesn’t plug into Subpanels by default, but fortunately this is pretty simple to do.
There are two files to touch for this. First, add a new file named SugarWidgetSubPanelMoreInfo.php in the custom/include/generic/SugarWidgets/ directory with the following contents:
This defines how the field should look, which for our case should be identical to how it is on ListViews ( meaning that it shows an icon that when clicking it makes an AJAX call via JS to grab the widget ).
Now, we just need to add an entry into the metadata for the subpanel we want to show this on. So let’s say we want to add the icon for the Contacts subpanel on the Accounts module. It uses template modules/Contacts/metadata/subpanels/ForAccounts.php, so to override in a safe way copy to the custom/modules/Contacts/metadata/subpanels/ForAccounts.php directory and add a new entry at the end like this:
With that you should have the icon at the end of each record in the SubPanel.