Print this page

"Login as Portal User" doesn't retain customer portal styles

Knowledge Article Number 000181237
Description When user tries to "Login as portal User" from Contact record, it doesn't retain the custom styles(Site template) that are used for customer portal pages.
Default Salesforce site header and footer are being displayed instead of "site template". Standard pages that are being used in customer portal retains custom Header and Footer but custom visualforce pages doesn't.
Resolution Check if the user is using this tag "<apex:composition template="{!$Site.Template}">" in visualforce page. Here the {!$Site.Template} attribute becomes null  since user is not running in sites context. So default header and footer  styles are displaying. It will display the custom styles if you keep visualforce page name (SiteTemplate) in <apex:composition> tag  instead of {!$Site.Template}.

<apex:composition template="SiteTemplate">


promote demote