2

I just tried the base example Visualforce page:

<apex:page>
  <!-- Begin Default Content REMOVE THIS -->
  <h1>Congratulations</h1>
  This is your new Page
 <!-- End Default Content REMOVE THIS -->
</apex:page>

and there is no header or sidebar on the preview, just the content. I thought that the header & sidebar were automatically set to be visible - what am I missing?

1

Those two should show by default, though the sidebar might be hidden for your user.

Add the following to the page declaration to explicitly show them.

<apex:page sidebar="true" showHeader="true">

You can get all the info on the apex:page tag here

| improve this answer | |
  • Thanks @Sebastian - per my comment above, adding sidebar="true" and showHeader="true" have no effect. Is there a user setting that would override these values (seems odd if you explicitly set them that they would still be overridden) – dbcn Feb 22 '17 at 14:00
  • Are you displaying this page in Lightning, by any chance? – Sebastian Kessel Feb 22 '17 at 16:42
  • I believe so - I just signed up for a Developer account, and the url includes lightning.force.com – dbcn Feb 22 '17 at 18:49
  • Header/Sidebars will NEVER show in Lightning (like you see in the post that @Oleksiy made). Switch to Classic and they should work – Sebastian Kessel Feb 22 '17 at 18:56
  • 1
    Ah... that makes more sense - the documentation seems like you are creating a full page rather than a page element. I literally clicked to create a new VF page, then clicked the preview button, and only saw the page content. Thanks for the help! – dbcn Feb 22 '17 at 20:27
3

In Salesforce classic the showHeader="true" and sidebar="true" attributes on the <apex:page> element enable both the header and sidebar.

In Salesforce lightning these values are automatically overridden. You can still enable them by using the setup="true" attribute on the <apex:page> element this enables both the header and sidebar.

| improve this answer | |
1

Visualforce Developer Guide says:

showHeader Boolean value that specifies whether the Salesforce tab header is included in the page. If true, the tab header is displayed. If not specified, this value defaults to true.

Note: In Lightning Experience and Salesforce1 the value of this attribute is overridden, and is always false.

| improve this answer | |
  • Thanks @Olesky, but adding showHeader="true" and sidebar="true" yield the same result (no header or sidebar). – dbcn Feb 22 '17 at 13:58
0

I was able to do this by adding the setUp = "true" attribute to the tag

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.