I’d like to completely customize a view. I want the view to be void of the standard SuiteCRM “chrome”. No menus, header, recently used, footer, etc. I basically want the supporting .js files for SuiteCRM, but I want the page to not appear as though it is in SuiteCRM.
By following the steps in an old post (Hello World), I see I can get rid of all the chrome. Is this the best approach to achieving this? Or is there another suggestion someone can point me towards?
Hi,
For me and if i have good understand, I do a custom view / controller like this.
http://watchcatblog.blogspot.be/2011/07/sugarcrm-adding-custom-view-using-mvc.html
There are many tutorials online (including the one you referenced) about creating custom views. But I cannot find is a tutorial or instructions explaining how to remove the headers, footer, sidebars and all that relating to the “normal” SuiteCRM look. What I want to do is create a view that is basically blank and free from all the suiteCRM Chrome.
If you look my code :
function action_Map() {
global $current_user;
global $timedate;
//echo '<pre>'; var_dump($_REQUEST); echo '</pre>'; echo '<pre>'; var_dump($_POST); echo '</pre>';die();
// $_REQUEST['select_entire_list'] == 1;
// $_REQUEST['current_query_by_page']
$i = 1;
$data = '';
if ($_REQUEST['select_entire_list'] == 1){
$mass = new MassUpdate();
//$mass->setSugarBean($bean);
$mass->generateSearchWhere($_REQUEST['module'], $_REQUEST['current_query_by_page']);
$seed = BeanFactory::getBean($_REQUEST['module']);
$query = $seed->create_new_list_query('name ASC', $mass->where_clauses);
//var_dump($query); die();
$result = $GLOBALS['db']->query($query, true);
while($row = $GLOBALS['db']->fetchByAssoc($result) )
{
$data .= '{coordinates: new google.maps.LatLng(' .$row['billing_lat'] .',' .$row['billing_lng'] .'), id: "' .$i .'", title: "' .$row['name'] .'", address_details: "' .$row['name'] .' "},';
$i++;
}
}else{
if ( !empty($_REQUEST['uid']) ) {
//echo '<pre>'; var_dump($_REQUEST); die(); echo '</pre>';
$recordIds = explode(',',$_REQUEST['uid']);
$data = '';
foreach ( $recordIds as $recordId ) {
$bean = SugarModule::get($_REQUEST['module'])->loadBean();
$bean->retrieve($recordId);
$data .= '{coordinates: new google.maps.LatLng(' .$bean->billing_lat .',' .$bean->billing_lng .'), id: "' .$i .'", title: "' .$bean->name .'", address_details: "' .$bean->name .' "},';
$i++;
}
}
}
include('custom/include/mydir//map/map.html');
die();
}
I load a basic HTML file… with no suitecrm css but i have always my bean.
This is for custom action but, you can add a custom button with id of the bean and the url of the action.
Or maybe, your view must not extend a sugar view. I am not try this.
Can someone explain how to use the SugarView options
show_title
show_footer
show_header
etc
??
It appears like creating a view setting these options to FALSE might achieve what I am looking for…however I am stumped right now on how to set these to false and use them.
You can remove the SuiteCRM header and footer by creating a custom view and having this code:
class myCustomView extends SugarView {
public function __construct() {
parent::SugarView();
$this->options['show_footer'] = false;
$this->options['show_header'] = false;
}
}
1 Like