Metafields the theme reads
Every metafield Kera reads, with its owner, key and type, how to create each definition, and how to connect your own metafields to blocks.
Kera reads these metafields by name. All are optional. Use exactly this namespace, key and type.
Set it up#
- In Settings > Metafields and metaobjects (opens Shopify admin in a new tab), choose Products, Collections, Blog posts or Markets.
- Click Add definition and enter a name.
- Click the namespace and key under the name and set it exactly, for example
custom.real_size. - Choose the type from the table below, then save. Fill it in at the bottom of each item in the admin.
| Owner | Namespace and key | Type | What uses it |
|---|---|---|---|
| Product | custom.size_guide |
Page | The size guide opens this page first. |
| Product | custom.real_size |
Single line text, for example 24 mm |
A real-size label on cards with Name inside the image. |
| Product | custom.cart_upsells |
Product, List of products | Complete the look in the bag. Up to 3 are used. |
| Product | custom.size_previews |
Metaobject, List of entries (Size preview) | Size comparison with Sizes set to Product metafield: one worn photo per size. See Size comparison. |
| Product | reviews.rating |
Rating | Star ratings on product cards, the Rating block and structured data. Set by your reviews app; you don't need to create it. |
| Product | reviews.rating_count |
Integer | The review count after the stars. Set by your reviews app. |
| Product | seo.hidden |
Integer, value 1 |
Hides a product from search and the Gift finder. Usually set by SEO apps; you don't need to create it. |
| Collection | custom.view_toggle |
True or false | Turns the Worn / Still toggle on or off. |
| Collection | custom.real_size |
Single line text, for example 12–30 mm |
A real-size label on collection cards. |
| Article | custom.reading_time |
Integer (minutes) | Reading time. |
| Article | custom.products |
Product, List of products | Shop the story. Up to 4 are used. |
| Market | custom.free_shipping_threshold |
Decimal | The market's free shipping goal, in its currency. |
| Market | custom.free_gift_threshold |
Decimal | The market's free gift goal, in its currency. |
Amounts are in the currency's main unit: for 150 euros, enter 150. If Markets isn't offered as an owner, use the amounts in Theme settings > Cart; they apply when customers pay in your store currency.
Do it with Sidekick
Sidekick can't create metafield definitions yet, but it can walk you through them. In the Shopify admin, paste:
Walk me through creating a product metafield definition with namespace and key custom.real_size, type Single line text, and show me how to fill it for many products at once.
Good to know#
What happens when a metafield is empty?
| Namespace and key | When empty |
|---|---|
custom.size_guide |
A page named size-guide-<product type>, then the block's page, then Size guide page in Theme settings > Drawers and overlays. |
custom.real_size |
Nothing shows. |
custom.cart_upsells |
The block's collection, then the first item's first collection. |
custom.size_previews |
Size comparison hides on that product's page. |
reviews.rating |
No stars show. |
reviews.rating_count |
The stars show without a count. |
seo.hidden |
The product is included. |
custom.view_toggle |
Shows when products have a second photo and Show worn and still toggle is on. |
custom.reading_time |
Words ÷ 200, minimum 1. |
custom.products |
Nothing shows. |
custom.free_shipping_threshold |
Free shipping from in Theme settings > Cart, for store-currency customers only. |
custom.free_gift_threshold |
Free gift from in Theme settings > Cart, for store-currency customers only. |
How do I show a badge from my own metafield?
Create a product metafield, for example custom.badge, then enter namespace.key in Badge metafield in Theme settings > Badges (installs empty). Set Metafield badge position, Metafield badge style, Show on product page and Position on product page. Supported types:
- Single line or multi-line text: one badge.
- Single line text, List of values: one badge per value, up to 3.
- Metaobject, or a list up to 3: one badge per entry, from its
labelfield (ortext, ortitle). Optionalbackground_color,text_colorandborder_colorfields override Metafield badge style.
How do I connect my own metafields to blocks?
Use a dynamic source for details the theme doesn't read by name, such as metal or stone. Create and fill the definition, open the template in the theme editor, hover over a block setting and click Connect dynamic source. Only metafields whose type fits are listed. Settings made for this:
| Block | Setting | Suggested metafield |
|---|---|---|
| Eyebrow | Text | Single line text, such as custom.material |
| Text | Text | Single line text, such as a subtitle |
| Collapsible row | Content | Rich text or multi-line text, such as care instructions |
| Complete the stack | Products | Product, List of products, such as custom.stack |
The installed theme connects no dynamic sources. If a template points to a definition your store doesn't have, Shopify can't use that template, so create the definition first.
I filled in the metafield, but nothing shows.
Check the namespace and key in Settings > Metafields and metaobjects (opens Shopify admin in a new tab). A definition named "Real size" with the key custom.realsize isn't read. The key must match the table exactly.
Can a metafield power a collection filter?
Yes, through Shopify's Search & Discovery app, not the theme. See Collection page and filters.