Using Font Awesome for Custom Page

Hi, we want to build customized edit and detail view page for our custom module.
Our UI / UX designer is using font awesome to add some icons to the buttons.
But, when I implement it, the icons are shown but other javascript files not working.
I have checked via Google Chrome Inspect Tools, but no error found.

How to solve this issue?
How to make all script (css and js) working properly even added font awesome script?

Thanks in advance.

SuiteCRM already includes Font-Awesome, and you can find examples in the code of how to use it. Are you using the latest SuiteCRM version?

No, I am using SuiteCRM version 7.8.5

In order to include custom files in Edit or Detail View, you can add them in their respective defs files. For example for adding a JS or CSS file for EditView, we would modify the modules editviewdefs.php. Check this file at custom/modules/<MODULE_NAME>/metadata/editviewdefs.php . If it does not exists, copy it from modules/<MODULE_NAME>/metadata/editviewdefs.php to this path.

Now modify the editviewdefs.php code as follows.



$viewdefs [$module_name] = 
array (
  'EditView' => 
  array (
    'templateMeta' => 
    array (
      'maxColumns' => '4',
      'form' => 
      ( .....
      ),
      'includes' => 
      array (
        0 => 
        array (
            'file' => 'custom/modules/<MODULE_NAME>/js/custom.js',
        ),
      ),

The includes index is where you add the array for custom files.

1 Like