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:
- Make sure the template or widget is selected in the Page Structure pane and click Edit Custom Properties in the Properties pane.
-
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.
- Enter the property label, which appears in the Properties pane of a widget instance or page—for example, Video URL.
-
Optionally, update the expression name that was added automatically.
Expression names are case sensitive and can't include spaces.
- Specify the property type and value.
- Optionally, mark the property as required.
- Add additional properties or sections as needed. Reorder items by dragging them to a new location.
- 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.
-
Use the syntax {!expression_name} to reference the
expression—for example, {!videoURL}.
When the page loads, the expression is replaced by the property value.
-
Add any additional text you require and save your changes.
For example,
Check out our video at {!videoURL}.
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.