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
SCRSCR 

Intermittent Styles in Sites Pages

Hi - I have a Sites Page that the style in the Coposition Template is inconsistentlly applied.  When you first goto the Sites Home the styles are not applied, but when you use the search form to return some results the style is applied.  This happens in all of the related Sites Pages. Any ideas?

 

Thanks in advance. SCR

 

Sites VF Markup Home Page:

<apex:page showheader="false" action="{!initList}" controller="PublicJobSearchController" standardStylesheets="true"> <!-- The site template provides the layout and the style for the site --> <apex:composition template="{!$Site.Template}"> <apex:define name="body"> <apex:form > <!-- Search by Department, Location and Keyword --> <apex:pageBlock title="Search Job Postings"> <apex:pageBlockSection columns="1"> <apex:pageBlockSectionItem > <apex:outputText value="Department"/> <apex:selectList value="{!viewDepartmentName}" id="departmentViews" size="1" required="true"> <apex:selectOptions value="{!DepartmentViewNames}"/> </apex:selectList> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputText value="Location"/> <apex:selectList value="{!viewLocationName}" id="locationViews" size="1" required="true"> <apex:selectOptions value="{!LocationViewNames}"/> </apex:selectList> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputText value="Keyword"/> <apex:inputText value="{!searchPosition}"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputText value=""/> <apex:commandButton value="Search" action="{!PopulateQuery}" reRender="JobList" /> </apex:pageBlockSectionItem> </apex:pageBlockSection> </apex:pageBlock> </apex:form> <!-- Search results --> <apex:pageBlock title="Search Results"> <apex:pageBlockTable id="JobList" value="{!Position}" var="Position__c" rendered="{!NOT(ISNULL(Position))}"> <apex:column > <apex:facet name="header"> <apex:outputText value="Position ID"/> </apex:facet> <apex:outputLink value="PublicJobDetails?id={!Position__c.id}" id="theLink">{!Position__c.name}</apex:outputLink> <!-- Position name field is linked to the job details page --> </apex:column> <apex:column > <apex:facet name="header"> <apex:outputText value="Title"/> </apex:facet> <apex:outputText value="{! Position__c.Position_Type__r.Name}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:outputText value="Department"/> </apex:facet> <apex:outputText value="{!Position__c.Department__c}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:outputText value="Location"/> </apex:facet> <apex:outputText value="{!Position__c.Location_City_State_Country__c}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:outputText value="Job Description"/> </apex:facet> <apex:outputText value="{!Position__c.Job_Description__c}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:outputText value="Position Open Date"/> </apex:facet> <apex:outputText value="{!Position__c.Open_Position_Date__c}"/> </apex:column> </apex:pageBlockTable> </apex:pageBlock> </apex:define> </apex:composition> </apex:page>

 

Best Answer chosen by Admin (Salesforce Developers) 
BulentBulent

I'm guessing the search page mentioned here is the standard search page not a visualforce page.

The reason you are not getting the same look and feel is that your visualforce page has the showHeader="false" attribute.

 

try setting the tabstyle attribute as part of your page tag

 

tabStyle

 

String

 

The Salesforce object or custom Visualforce tab that controls the color,styling, and selected tab for this page. If using a Salesforce object,the attribute must be specified with the developer name for the object.For example, to use the styling associated with MyCustomObject, usetabStyle="MyCustomObject__c". If not specified, this value defaults tothe style of the associated controller (if a standard controller), orthe Home tab (if a custom controller). To use a custom Visualforce tab,set the attribute to the name (not label) of the tab followed by adouble-underscore and the word tab. For example, to use the styling ofa Visualforce tab with the name Source and a label Sources, usetabStyle="Source__tab".