HOWTO: Add the 'More Info' popup to Subpanels

sugarcrmdevelopers —  April 6, 2012 — 35 Comments

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.

35 responses to HOWTO: Add the 'More Info' popup to Subpanels


    Couple problems:

    #1 – Sorting by the more_info column which cause DB ERROR!  I accidently clicked on the column header which makes it sort by this column.  This effectively broke my Accounts module b/c of a database failure.    MySQL error 1054: Unknown column ‘more_info’ in ‘order clause’

    You should update the post which also includes: ‘sortable’ => false

    I’m not sure where this preference is stored… but fortunately it didn’t stick around between sessions.  Removing it from my metadata and then doing a repair didn’t fix it.  But, logging out, logging in as a different user, then logging back in with my original user did resolve the problem.

    #2 – LBL_MORE_INFO shows up as column header.  So, I assume we also need to add something to the labels?  Best way to do this is through studio?

    #3 – Your code got HTML escaped and as a result it’s not pastable.  Had to make quite a few changes.  My change doesn’t include anything for the alt attribute that part got completely cut off.

    getImageURL(‘info_inline.gif’); $id = $layout_def[‘fields’][‘ID’]; $spanId = “mip_” . $id; $theModule = $layout_def[‘module’];    $extra = ““;   return $extra; }}?>

    #4 – I think most people would prefer to have it so when you hover over the link field it displayed more info.  Thoughts on extending SubPanelDetailViewLink widget to handle on hover events?


    Hi guys, would like to check if i want to add this on History subpanel is it possible? i tried follow your way, it given me error..

Trackbacks and Pingbacks:

  1. How to add "More Info" icon with mouseover action to History subpanel - April 10, 2012

    […] […]

  2. Is there a upgrade safe way to extend SugarWidgets? (More of a PHP question) - April 13, 2012

    […] […]

  3. SugarCRM Developer Blog » Blog Archive » HOWTO: Add more info hover links to any record link in a subpanel - May 8, 2012

    […] a follow-up to an earlier blog post, Sugar Professional customer and avid community member Blake Robertson asked this […]

  4. Customise subpanel for History on sugarcrm v6.5.4 - September 26, 2012

    […] […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s