You are here:
Display Attributes on an Object Page
You can add an Attributes component to the Visualforce page for any object that supports attributes. For example, you can display Attributes that capture information about Opportunities.
To add Attributes to an object page by creating your own Visualforce component for that object, perform the following steps in Salesforce Classic:
- From Setup, type Pages in Quick Find, then click Visualforce Pages.
- Click New.
- Add a Label and Name, for example, OpportunityAttributesPage.
- Check the box labeled Available for Lightning Experience, Lightning Communities, and the mobile app.
-
In the Visualforce markup section, add the following code:
<apex:page showheader="false" sidebar="false" standardcontroller="ObjectAPIName"> <apex:stylesheet value="{!URLFOR($Resource.NS__bootstrap, '/bootstrap-3.2.0-dist/css/sfboot.min.css')}"> <NS:SegmentComponent > </NS:SegmentComponent> </apex:stylesheet> </apex:page> -
Replace ObjectAPIName with the API name of the
object to which you want to add Attributes, for example,
Opportunity. - Replace NS with the Namespace prefix of the installed package, which is located in Setup > Installed Packages. If there is no namespace, omit the NS instances and the colons that follow.
- Click Save.
- Click Visualforce Pages again to return to the list of pages.
- Next to the new page, click Security.
- Grant access to the profiles that need access to the new page, then click Save.
- Navigate to the page for the object. For example, go to the Opportunities tab and click one of the Opportunity names.
- Select Edit Layout.
- In the Layout Editor, scroll the pane at the top left that begins with Fields, Buttons, Custom Links, and so on until you see Visualforce Pages.
- Click Visualforce Pages.
- Drag your new Visualforce component onto the layout.
- Click Save.
