Improving the workflow with metafields
Metafields are global objects that allow us to store additional data inside our admin and output it to the storefront. As such, they are both powerful and necessary tools for creating complex designs with unique content.
Metafields consist of three mandatory elements:
- The namespace, which we can use to group different metafields, so long as they share the same namespace.
- The
key
attribute, which allows us to access a specific metafield. - A value where we can store an integer, string, or
json_string
data type.
We can also use a description
field for the short description of a metafield, which is optional compared to the previous three.
Metafields, while powerful tools, had quite a disadvantage as they were only available through third-party apps. However, since the Shopify Unite 2021 event, the metafields functionality has become available natively inside the Shopify dashboard, and not only that, but it has received...