Add Custom Properties to Page Templates or Widgets

When you create a page template or a widget, you can add custom properties to it and specify the value and type of each property.

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

Then, by adding custom code or content blocks to the page template or widget, you can access the property values using expressions, which serve as placeholders for the values. When you or your team create a page from the template or add an instance of the widget to the page, you can update the property values to modify the instance.

When the page template or widget is open:

  1. Make sure the template or widget is selected in the Page Structure pane and click Edit Custom Properties in the Properties pane.
  2. Click New Property.
    Base is the default section, which you can rename. Sections control how properties are grouped in the Properties pane of a widget instance or page.
  3. Enter the property label, which appears in the Properties pane of a widget instance or page—for example, Video URL.
  4. Optionally, update the expression name that was added automatically.
    Expression names are case sensitive and can't include spaces.
  5. Specify the property type and value.
  6. Optionally, mark the property as required.
  7. Add additional properties or sections as needed. Reorder items by dragging them to a new location.
  8. To use a custom property, drag a Custom Code or a Content Block page element from the Page Element tab onto the page template or widget.
  9. Use the syntax {!expression_name} to reference the expression—for example, {!videoURL}.
    When the page loads, the expression is replaced by the property value.
  10. Add any additional text you require and save your changes.
    For example, Check out our video at {!videoURL}.
Tip
Tip You can also create a custom property by first typing the name of the property in custom code or a content block using expression language. For example, if you type {!videoHeight} in a content block, a new property called videoHeight is automatically added to the Properties pane of the template or widget, where you can then add a property value.

If you update a widget's properties, your changes aren’t reflected in any widget instances. Instead, you must replace existing widget instances with the latest version.

If you delete a custom property that's being used in custom code or a content block, make sure you remove any references to the property.