How to setup Metafield in version 1.3.0?
From version 1.3.0, the sections and blocks that display metafield content no longer read a fixed, hard-coded key. Each one now has a Metafield setting where you type the metafield in namespace.key format. You can keep the theme's default key, or point the setting at any metafield you like.
Why this is useful
1. Use the same block more than once on a page, each with different content.
Because the key is a setting, you can add the same block several times on one page and give each copy its own metafield. For example, one Highlights block can read custom.highlights while a second Highlights block on the same page reads custom.highlights_2, so each shows different content. With a fixed key, every copy would show the same thing.
2. Name the metafield to suit you.
Create the metafield under your own naming convention (useful for agencies and brands, for example mybrand.highlights) and point the setting at it, or simply keep the theme's default key and change nothing.
How it works
Each feature below has a Metafield setting: a text field where you enter the metafield as namespace.key, for example custom.highlights.
Example: two of the same block on one page
- In Settings -> Custom data, create two metafields, for example
custom.highlightsandcustom.highlights_2, and fill each with different content on your product. - On the product page, add two Highlights blocks.
- Leave the first block's Metafield as
custom.highlights; set the second block's Metafield tocustom.highlights_2. - Each block now shows its own content.
Example: rename for your brand
- Create the metafield under your own name, for example
mybrand.compare_items. - Open the Compare products section and set Compare items metafield to
mybrand.compare_items. - The section now reads your metafield instead of the default.
Where the Metafield setting appears
Each row links to the page that shows how to create that metafield or metaobject. The default key is what the feature uses if you leave the setting unchanged.
Product blocks
| Block | Metafield setting | Default metafield |
|---|---|---|
| Description | Short description metafield |
|
| Highlights | Highlights metafield |
|
| Key features | Key features metafield |
|
| See it in action | Media lightbox metafield |
|
| Model size | Model size metafield |
|
| Product sizing | Product sizing metafield |
|
| Shop the look | Shop the look metafield |
|
Sections
| Section | Metafield setting | Default metafield |
|---|---|---|
| Shop similar product | Similar products metafield |
|
| Bought together products | Frequently bought together metafield |
|
| Complete the look | Complete the look metafield |
|
| Key ingredients | Info gallery metafield |
|
| Compare products | Compare items metafield |
|
| Compare products | Ingredient highlights metafield |
|
| Sub collection | Subcollection metafield |
|
Theme settings
| Location | Metafield setting | Default metafield |
|---|---|---|
| Theme settings -> Product cards | Scrolling text metafield |
|
| Theme settings -> Cart | Collection empty metafield |
|
No comments yet