SugarCRM7 HOW TO: add subpanels for related custom modules

Idea created by Francesca Shiekh on Oct 29, 2015
    Active
    Score25
    • Surabhil Sergy
    • Francesca Shiekh
    • Lenin Jose Meza Zarco
    • Graham Wells
    • Kristjan Geir Mathiesen

    To add sub panels for related custom  modules:

    In:

        <sugar_root>/custom/Extension/modules/<module>/Ext/clients/base/layouts/subpanels/<yourfilename>.php   

     add the definition for the sub panel  to the subpanels components:

         $viewdefs[‘<module>’][‘base']['layout']['subpanels']['components'][]  = array (
       'layout'=>'subpanel',
       'label' => '<LBL_SUBPANEL>',
       'context' => array(
          'link' => '<relationship_name>',
       )
    );                           


       

    For Example to add the custom "customer visits" sub panel on Accounts:

       

     

        $viewdefs['Accounts']['base']['layout']['subpanels']['components'][] = array (
     'layout'=>'subpanel',
     'label' => 'LBL_CUSTV_CUSTOMER_VISITS_ACCOUNTS_TITLE',
     'context' => array(
        'link' => 'custv_customer_visits_accounts',
     )
    );
     
    Where the link is the name of the
    relationship as found in Studio->Accounts->Relationships.                                   

    Critique welcome.
    FrancescaS