Displaying Data or Content Using Custom Code

In addition to data elements and content blocks, you can also use custom code as an alternative way to display data in a data repeater or in a page data connection. It's particularly useful for displaying field data that's inline with text.

Required Editions

Available in: Salesforce Classic

Available for purchase in: Enterprise, Performance, and Unlimited Editions

Available (with limitations) in: Developer Edition

User Permissions Needed
To build, edit, and manage Site.com sites:

Site.com Publisher User field enabled on the user detail page

AND

Site administrator or designer role assigned at the site level

When the page is open:

  1. Drag a Custom Code page element from the Page Elements pane onto the data repeater. Alternatively, if the page has a page data connection, drag the Custom Code page element directly onto the page canvas.
  2. To access the fields of the object that the data repeater or page is connected to, type {! and double-click the expression that you want to display.
    Note
    Note The object's fields are listed first, followed by the fields of all parent objects, which use the format parent_object_name.field_name.
  3. Add any additional expressions or text you require. For example:
    To contact {!Name}, call {!Phone}.

    where {!Name} and {!Phone} are placeholders for the values of the Name and Phone fields of each record.

  4. Click Save and Close.