Style Block Object Reference
On this page
Overview
Style Blocks contain CSS code that will be included on your web store.
| Property | Value |
|---|---|
| API Name | s_c__Style_Block__c |
| Label | Style Block |
| Plural Label | Style Blocks |
| Type | Custom Object |
Fields
| Field Label | API Name | Type | Required | Description |
|---|---|---|---|---|
| Active | s_c__Active__c |
Checkbox | No | Defines whether the Style Block is active. Only active Style Blocks will be included on the website. |
| Channels | s_c__Channels__c |
MultiselectPicklist | No | The channels this style block applies to (e.g. web, pos). |
| Content | s_c__Content__c |
LongTextArea(131072) | No | The CSS code of the Style Block, without any |
| Global | s_c__Global__c |
Checkbox | No | Defines whether the Style Block is automatically included on the website. |
| Media | s_c__Media__c |
Picklist | No | Specifies what media/device the CSS style is optimized for. |
| Position | s_c__Position__c |
Number(18,0) | No | This defines the display order of the Style Blocks on the website. Lower numbers appear first. Only applies when Global is checked. |
| Store | s_c__Store_Id__c |
Lookup (s_c__Store__c) | Yes | The Store that the Style Block belongs to. |
| Stylesheet URL | s_c__Url__c |
Url | No | The URL of an external Stylesheet to be included. If a value is specified, any value in Content will be ignored. |
| StoreConnect External ID | s_c__sC_Id__c |
Text(36) | No | StoreConnect External ID, do not modify in Salesforce |
Relationships
| Field | Type | Related Object | Relationship Name |
|---|---|---|---|
s_c__Store_Id__c |
Lookup | s_c__Store__c | Style_Blocks |
On the storefront
Storefront templates read this object through the Style Liquid object, written as style in a theme.
| Salesforce field | Liquid attribute |
|---|---|
s_c__Media__c |
style.media |
s_c__Position__c |
style.position |
s_c__Url__c |
style.url |
Fields you add yourself are not listed above. Expose one with a Custom Data Mapping record, then read it from style.data. See custom data fields in Liquid.
Was this article helpful?
Thanks for your feedback! It helps us improve our docs.