metafield
A metafield attached to a parent object.
To learn about how to access a metafield on a specific object, refer to Access metafields.
| Properties | Description |
|---|---|
value | The value of the metafield. |
The following table outlines the value format for each metafield type:
Type | Returned format |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
Access metafields
The access path for metafields consists of two layers:
namespace- A grouping of metafields to prevent conflicts.key- The metafield name.
Given this, you can access the metafield object with the following syntax:
{{ resource.metafields.namespace.key }}{{ product.metafields.custom.directions.value }}Take with a mealAccessing metafields of type
The value property of metafields of type json returns a JSON object. You can access the properties of this object directly in Liquid, either by name or 0-based index. You can also iterate through the properties.
Temperature: {{ product.metafields.custom.burn_temperature.value.temperature }}
Unit: {{ product.metafields.custom.burn_temperature.value['unit'] }}
{% for property in product.metafields.custom.burn_temperature.value %}
{{ property[0] | capitalize }}: {{ property[1] }}
{% endfor %}Temperature: 700
Unit: degrees
Temperature: 700
Unit: degrees
Scale: FahrenheitUpdated 23 days ago
