---
schema_version: "1"
id: 52b0eef2077bad402edf460bce53e9b67999f2d3346b4688f605d9eb94f47dc5
title: Displaying Data or Content Using Custom Code
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/siteforce_data_code.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.siteforce_data_code.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 37e840a54d55f92606790559948912c1682b985b7ccc671b09d2f49acf383de7
description: 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.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# 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

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition">
        <colgroup>
          <col>
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Available in: Salesforce Classic</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>Available for purchase in: <strong>Enterprise</strong>, <strong>Performance</strong>,
                and <strong>Unlimited</strong> Editions</p>
              <p style="margin-bottom:0;">Available (with limitations) in:
                <strong>Developer</strong> Edition
              </p>
            </td>

          </tr>
        </tbody>
      </table> <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d157642e74">User
              Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d157642e74 ">To build, edit, and manage Site.com sites:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d157642e74 ">
              <p><samp class="parmname">Site.com Publisher User</samp> field enabled on the
                user detail page</p>
              <p>AND</p>
              <p style="margin-bottom:0;">Site administrator or designer role
                assigned at the site level</p>
            </td>

          </tr>
        </tbody>
      </table>

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](https://help.salesforce.com/s/articleView?id=platform.siteforce_data_merge_fields.htm&release=264.0.0&type=5 "Site.com uses expression language to display data dynamically. Expressions serve as placeholders for data that is replaced with information when the page loads. When working with data-bound page elements or custom widget properties, you can use expressions to customize how data is displayed on the page.") that you want to display.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_note.png)
    
    Note The object's fields are listed first, followed by the fields of all [parent objects](https://help.salesforce.com/s/articleView?id=platform.siteforce_data_nested_overview.htm&release=264.0.0&type=5 "Standard and custom objects have relationships that define how records in one object relate to records in another. For example, the Accounts object has a one-to-many relationship with the Contacts object—that is, each account can have one or more contacts associated with it. This relationship is also known as a parent-to-child or a master-detail relationship."), 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**.

#### See Also

- [Dynamically Retrieve Data with Data Repeaters](https://help.salesforce.com/s/articleView?id=platform.siteforce_data_repeater.htm&release=264.0.0&type=5 "Use a data repeater to connect to a standard or custom Salesforce object and retrieve a dataset based on the filter criteria that you specify.")
- [Retrieving Data with Page Data Connections](https://help.salesforce.com/s/articleView?id=platform.siteforce_data_page_connection.htm&release=264.0.0&type=5 "Use a page data connection to create a detail page for a single record when working with Salesforce objects.")
- [Displaying Data Using Content Blocks](https://help.salesforce.com/s/articleView?id=platform.siteforce_data_content_block.htm&release=264.0.0&type=5 "In addition to data elements and custom code, you can also use content blocks 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.")
- [Data Filter Examples](https://help.salesforce.com/s/articleView?id=platform.siteforce_data_repeater_examples.htm&release=264.0.0&type=5 "When working with data repeaters, data tables, and data functions, you can filter the data you retrieve in many ways. In this topic, we explore two options— fixed values and URL query strings—to illustrate some common filtering techniques.")