2

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.

1 Answer 1

4

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>
1
  • 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, 2014 at 16:55

You must log in to answer this question.

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