I need to set the showheader property in visualforce page to true or false based on user profile. For all internal salesforce users the showheader property should be set to true and for all external/portal users the showheader should be set to false.

<apex:page standardController="Contact" showHeader="true">
    <apex:detail relatedList="true" inlineedit="TRUE" />
  • @Eystornt Using rendered attribute within apex detail section, can we set showheader property to true or false? For all profiles i need to display the same detail but only i need to change the showheader attribute.
    – Ean
    Oct 26, 2016 at 12:10
  • Ha, my bad. I read that question too quickly ! Wait a second Oct 26, 2016 at 12:10
  • @Eystornt Ok Sure.
    – Ean
    Oct 26, 2016 at 12:12
  • Apparently you can use the attribute rendered on the <apex:page> tag. So you can do something like <apex:page standardController="Contact" showHeader="true" rendered="{!$Profile.Name == 'SomeProfileName'}"> Oct 26, 2016 at 12:13
  • From where users navigate to the page, can you write some condition over there?
    – Raul
    Oct 26, 2016 at 12:26

1 Answer 1


The showHeader attribute supports normal Visualforce expressions so you can reference Visuaforce globals like $Profile or controller boolean properties.

For example, this will only show the header for SA users:

<apex:page showHeader="{! $Profile.Name == 'System Administrator' }">
Page content

No need for 2 pages.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .