function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Swetha A 5Swetha A 5 

hide sidebar and header from standard salesforce page

Hi all,

Can we remove the sidebar and header from a standard salesforce page using a visualforce page?
I mean Can we add any css or javascript function to achieve this? If this is possible, please provide me a solution. It's urgent.
Thanks in advance.
Best Answer chosen by Swetha A 5
Swetha A 5Swetha A 5
Hi all,
The issue got solved. Just add "&isdtp=vw" to the url in the action attributr of the apex:page and it is done. Looks so simple but it took lots of time to research. Anyways we got the answer. Cheers.

All Answers

NagaNaga (Salesforce Developers) 
Hi Swetha,


Let me know if this will help

<apex:page showHeader="false">

<chatter:feedWithFollowers entityId="{!$User.Id}" />

</apex:page>

Best Regards
Naga Kiran
Swetha A 5Swetha A 5
Thank you Naga.. I want to remove sidebar and header from a standard salesforce calendar page. Below is my code what I tried. Please go through and provide me solution.

Visualforce page:
<apex:page controller="DayValue1" action="/00U/c?cType=1&cal=UrUS&cal_lkid=023o0000000mGFt&cal_lkold=UrUS&cal_lspf=1&md0=2015&md3={!day}" showHeader="false" sidebar="false" standardStylesheets="false">
<chatter:feedWithFollowers entityId="{!$User.Id}" />
</apex:page>

Apex class:
 
public class DayValue1{

    public Integer day{set; get;}
    
    public DayValue1(){
        date myDate = date.today();
        System.debug('Today date is '+myDate);
        day = myDate.dayOfYear();
        system.debug('Today dayofyear is - '+day);
    }
}

THe issue is I am getting the side bar and header when I add this page to homepage component. Thank you.
Gyanender SinghGyanender Singh
Hi Swetha,

i try lots of solution for this using inspect element but as you are using the direct url in the action so when you preview the vf page its open the direct url not the vf page, so first remove url from the actiion and after that try showheader= "false" and sidebar = "false" and cache = "false'.

Thanks
Gyani
Swetha A 5Swetha A 5
Hi all,
The issue got solved. Just add "&isdtp=vw" to the url in the action attributr of the apex:page and it is done. Looks so simple but it took lots of time to research. Anyways we got the answer. Cheers.
This was selected as the best answer
Ryan Sloan 43Ryan Sloan 43
Using the parameter isdtp with a value of vw in a Page Reference worked for me. Was able to see the OpportunityContactRole Edit screen without header or sidebar. Special thanks to Swetha A 5 for finding this information.

<apex:pageBlockButtons location="top" > 
         <apex:commandbutton action="{!redirect}" value="Edit Opportunity Contact Roles"/>
</apex:pageBlockButtons>


public PageReference redirect(){
        PageReference newPage = new PageReference('/p/opp/ContactRoleEditUi/e');
        newPage.getParameters().put('oppid', oppIds[0]);
        newPage.getParameters().put('retURL', returnUrl);
        newPage.getParameters().put('isdtp', 'vw'); <--This Line Takes out the header and sidebar
        newPage.setRedirect(true);
        return newPage;
    }

OpportunityContactRoles