Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

enter image description here

Anyone know how to emulate this using visualforce? Is there some sort of global variable commands to get the icon? or am i forced to cssing this all? I am just looking to get the top portion where the contact and contact.Name is. Thanks been trying to make a VF page that looks identical to the ones that salesforce provides.

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

To get the title and subtitle (in your example, "Contact" and "CT-0000000001"), use apex:sectionHeader. To get the icon and coloring, use the corresponding standardController on the page (in conjunction with apex:sectionHeader), putting any custom controller logic in a controller extension. For example:

<apex:page standardController='Contact' title='Contact - {!contact.name}'>
     <apex:sectionHeader title='Contact' subtitle='{!contact.name}'>
         <!-- you can add additional header content here if needed, for example, the 
              top-of-page help text on the Convert Lead page -->
     </apex:sectionHeader>
     <apex:form>
         <!-- rest of your page logic -->
     </apex:form>
</apex:page>
share|improve this answer
1  
To get the icon and the coloring you can also explicitly set the tabStyle attribute on the page tag with the name of the object whose look you're trying to mimic, which will set the CSS to match that object's look and feel. <apex:page tabStyle="Contact"> –  Mark Pond Feb 19 at 16:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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