Sometimes we need to hide header and sidebar of a Visualforce page or Standard layout. So here are some ways to hide header and sidebar for Salesforce Visualforce page and Standard layout.
Generally in Visualforce Page we use sidebar="false"
to hide sidebar. To hide header and chat widget we use header="false"
and showChat="false"
respectively.
- Hide Header and Sidebar from Visualforce Page with specifying
header="false"
andsidebar="false"
.
<apex:page showHeader="false" sidebar="false"> </apex:page>
- Hide Header and Sidebar from Visualforce Page or Standard Layout by adding
isdtp
parameter in the URL. The main purpose of isdtp can be used to hide Salesforce header and sidebar on Standard Pages.- vw – The Visualforce page will be rendered without header and sidebar, supports aloha theme, allows chatter.
- lt – leaves off SF formatting, page header, sidebar, tabs and section header.
- nv – The page will be rendered without the tabs and sidebar, and will accommodate all the buttons in a list view.
- mn – Retains Old Salesforce Styling, hides page header(tabs) and sidebar.
PageReference pgref = new PageReference('/apex/pagename?recordId&isdtp=vw);
https://ap1.salesforce.com/001?fcf=00B90000008Ajal?isdtp=vw
- Hide Sidebar from Standard layout.
Go to – Setup || Customize || User Interface – checked the check box “Enable Collapsible Section”. After that you can show or hide sidebar in Standard layout.