When you use Studio you can only build user interfaces of a predetermined layout, with predetermined elements. To go beyond the standard involves coding, but what options do you have?
I’m no expert but I have worked with a number of approaches which I had described below. As you can see, these are very much a work in progress.
1. Amend vardefs files
You can edit these directly. I will add an example later.
2. Use Logic Hook with after_ui_frame
This will add code after the UI has been loaded into the browser. You can’t just add text as I have done as there is no way of knowing where it will arrive in the page. It would be better to set the inner HTML, or add a javascript file, or style sheet.
I haven’t explored these but you can see that this does give you the scope to change or add to the UI
In the following example I have added code to the file custom/modules/Accounts/logic_hooks.php
|
1 2 3 4 5 6 |
$hook_array['after_ui_frame'][] = Array(2, 'Test Adding to UI', 'custom/modules/Accounts/ExtraUIStuff.php', 'ExtraUIStuff', 'showExtra'); |
And included ExtraUIStuff.php in the same directory, as follows.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<?php /** * Class to show extr stuff in UI */ class ExtraUIStuff { public function showExtra($event, $arguments) { print("some text or html to display"); } } ?> |
3. Add new Smarty files
This is the most flexible. I will add a section here to describe what is needed and what can be achieved.
See the following link, until I can test and add my own code.
http://www.dobre.name/sugarcrm/adding-header-or-footer-to-editview-in-sugarcrm.html
More to follow…..