TraitType - Liquid Object Reference
On this page
Description
The TraitType object defines a specific type of trait such as Width, Height, Color, Size. This belongs to a TraitCategory and can have many TraitValues.
:::note
This object supports custom data via the data attribute.
:::
Backed by
This drop renders the s_c__Trait_Type__c Salesforce object. A theme writes it as trait_type.
| Liquid attribute | Salesforce field |
|---|---|
name |
s_c__Display_Name__c |
unit |
s_c__Unit__c |
value_type |
s_c__Value_Type__c |
Every other attribute on this drop is derived by StoreConnect rather than read straight from one field. The Attributes section lists them all.
Fields you add yourself are not listed above. Expose one with a Custom Data Mapping record, then read it from trait_type.data. See custom data fields in Liquid.
Attributes
| Attribute | Type | Description |
|---|---|---|
display_on_product_page? |
Boolean | Indicates whether this TraitType should be displayed in specifications section on the product page. |
id |
String | Returns the unique id of this TraitType |
name |
String | Returns the name of the TraitType |
unit |
String | Returns the unit for this TraitType, eg: centimetres, kilowatts |
value_type |
String | Returns the value type for this TraitType, eg: number, currency, checkbox |
Available on
- Trait - Liquid Object Reference —
trait_type
Was this article helpful?
Thanks for your feedback! It helps us improve our docs.