Tuesday, September 25, 2012

Attributes for : showHeader, sidebar, standardStylesheets

As you know the most simplistic Visualforce page can look like this:

<apex:page>
<h1>main title</h1>
content
</apex:page>

You can provide attributes such as showHeader and sidebar to determine whether you want to show the header or sidebar, respectively, simply by setting the values to true or false, such as:


<apex:page showHeader="true" sidebar="false">
<h1>main title</h1>
content
</apex:page>


Do note that if showHeader is set to false, then sidebar will also be hidden!

Note also, that simply by setting showHeader = false, it does NOT mean you are not using the Salesforce's stylesheets (i.e. Salesforce stylesheets are still being applied).  If you do not want to use any Salesforce's stylesheets at all, then you also need to use the standardStylesheets attribute and set it to false.

No comments:

Post a Comment

Please leave a comment.