SuiteCRM into iframe without top menu and sidebar

Hi @pgr!
I change my implementation and I opted for a javascript that check:
I add in /custom/themes/SuiteP/js/style.js file, follow code:

$(document).ready(function () {
try {
    console.log('SuiteCRM is open into an IFrame: ', window.self !== window.top);
    if (window.self !== window.top){
        var element = document.getElementById('ajaxHeader');
        element.parentNode.removeChild(element);
        var mainContent = document.getElementById('bootstrap-container');
        mainContent.setAttribute("margin",0);
        mainContent.setAttribute("class","col-md-12");
    document.getElementByTagName("footer").className = "collapsedSidebar";
	 
    }
} catch (e) {
    console.log('SuiteCRM check open into an IFrame error');
}
});
1 Like