Help a newbie with customizing HTML

Hi,

I’m very new to the suitecrm tool. I found some html I’d like to customize in the SugarView.php file. Could someone tell me the correct way to add custom code. I thought that copying that file into the custom folder would be enough, but it didn’t seem to recognize my change. I’m sure I need to do more, but it would help to get some guidance and start on the right footing.

Thank you.

What are you trying to do?.

You cant just edit html anywhere in Suite/Sugar crm and just expect it to work. The system uses the smarty template engine for a start. But below this there is a metadata layer that defines the layout for every module and MVC layer that allows you to add custom views (which you can add raw html into if you want).

Ok, so where do I find the right way to do it? Some of the html IS in the SugarView.php, h2 tag at top of page for example. What do I need to do to do this? Is there a tutorial or something to review?

Hi cfowler,

The SugarView.php is a fundamental base for views/html/smarty php code and is a core file. Editing this is not upgrade safe, and regular changes are made to this file when SugarCRM is upgraded.

How do you want to customise the HTML? It may be possible by adding CSS in an upgrade-safe manner to the SuiteCRM theme.

Thanks,

Will.

Thanks for depth on SugarView.php. I simply want to add some labeling to clearly show which module you are in so basically a “ACCOUNT: My Account Name” type of thing, instead of just having the name there. There may be other small changes as well, but that is a small example. Where in the theme would I do this type of thing? All I had to go on at the time was searching for the h2 tag and I found it in SugarView.php

I apologize for being so vague, I’m still getting a grip on this and working through what I need to do. Within SugarView, there is function

public function getModuleTitle().

This does the following :

if(!empty($paramString)){
$theTitle .= "

$paramString

\n";
}

What is the proper place to edit the information that is being displayed in the string?

I’ve search the app to find what files call the getModuleTitle or us theTitle and there doesn’t seem to be any consitency. At least I can’t understand it. I don’t to edit the SugarView necessarily, but I do need to have control over some of the information that appears on screen.

It Sounds like you need to create a new theme or edit the existing one!
Forget about editing SugarView. You will never need to touch this file. If you did need to change something in it you would do it by extending the SugarView in each individual module and over righting the part you need to change. Sugar/SuiteCRM is not a website, its a complex object oriented software application and you really need to be an experienced software developer to understand it. You cant just go editing core files and expect not to break something and even if you do all your changes will be wiped out the first time you upgrade.

Check out these links:

http://support.sugarcrm.com/02_Documentation/04_Sugar_Developer/Sugar_Developer_Guide_6.5/02_Application_Framework/Themes/

http://developer.sugarcrm.com/2011/12/23/creating-custom-view-for-sugarcrm-module

http://iqbalmp.wordpress.com/2012/04/04/creating-custom-view-for-sugarcrm-modules/

http://forums.sugarcrm.com/f6/how-can-i-customize-theme-sugarcrm-ce-6-5-2-a-83212/

I think I got it now. I needed to override that method in a new file within the custom folder. Took me a bit, but I get it and can affect change w/o editing the main php.

Cool!