How to create a layout for a custom module in Sugar 7?

Adding a new layout/view for a custom module in SugarCRM 7 and following the guide here: http://support.sugarcrm.com/02_Documentation/04_Sugar_Developer/Sugar_Developer_Guide_7.1/20_UI_Mode...

But tweaked for a module instead of system-wide. When I repair and hit the desired URL (/#CoolModule/layout/setup) it is blank and I noticed that the layout/view is not being cached in /cache/modules/CoolModule like it does for other modules.

/modules/CoolModule/clients/base/layouts/setup/setup.php:
$viewdefs['CoolModule']['base']['layout']['setup'] = array(
    'type' => 'simple',
    //'span' => 12,
    'components' =>
    array(
        array(
            'view' => 'setup',
        ),
    ),
);
/modules/CoolModule/clients/base/views/setup/setup.js:
({
    className: 'setup tcenter',

    loadData: function (options) {
        this.render();
    }
})

/modules/CoolModule/clients/base/views/setup/setup.hbs:
<h1>My Setup View</h1>

do something!

Any help would be greatly appreciated!





  • Noticing that CoolModule never makes it to modules/ModuleBuilder/parsers/MetaDataFiles.php->getModuleClientCache() when it rebuilds the client cache.

    Also never gets to include/MetaDataManager/MetaDataManager.php->getModuleData() prior to that.

    EDIT: It looks like it is due to not defining the module in $app_list_strings. Confirming.
  • This is solved now. The key is that you have to define the module label or else the cache will not pick it up. The MetaDataManager depends upon the global $app_list_strings['moduleList'] array for the current list of modules to build the cache on.
  • Hi eggsurplus,

    Just a question on this custom layout "Setup" that you have created.

    Does the "Setup" view part of this layout also appear in Studio for changes ?

    I'm looking to create a custom layout+view where I can configure/customise the list of fields that should be available for some logic in the layout/view

    For that, I want this layout/view to be visible from Studio so I can modify the list of fields.

    Thanks!
    Kedar


  • Hi Kedar,

    It does not by default. There must be a way to enable or define a layout as being a Studio layout, but I haven't dug into that yet. Maybe someone else reading this will know?
  • Where we can write insert data code..?