Skip to content
Faith
⌘K
Skip to content

Metafields & custom data

Overview

Metafields store extra information that Shopify doesn’t have a field for, for example a product’s fabric, care instructions, size chart, a custom badge, or the other colors of a style. You create a metafield once as a definition in Settings → Custom data, then fill in its value on each product, variant, collection or page.

Faith uses metafields in two ways:

SettingsDescription
Read AutomaticallyFaith looks for metafields with specific names, such as theme.badge or theme.sibling_products, and uses them without any setup in the theme editor. Create the definition with the exact namespace and key, fill it in, and the feature appears.
Dynamic SourcesAny text, image or page setting with the Connect dynamic source icon can show a metafield you create, such as custom.material or custom.care_instructions. Each product then shows its own value.

Every metafield has a namespace and key, written as namespace.key, for example theme.badge. Faith uses the theme namespace for its own features, and custom for metafields you create yourself.

Create a Metafield Definition

Overview

A definition tells Shopify the metafield’s name, where it’s used and what type of value it holds. With a definition, the metafield shows as a field on each product in Shopify admin, and can be connected in the theme editor.

How to use

  1. In Shopify admin, go to Settings → Custom data.
  2. Choose where the metafield is used, for example Products, Variants, Collections or Pages.
  3. Click Add definition.
  4. Enter a Name, for example Badge.
  5. Click the Namespace and key field, and enter it exactly as listed below, for example theme.badge.
  6. Choose the Type, for example Single line text.
  7. Click Save.
  8. Open a product (or variant, collection or page), scroll to Metafields, fill in the value, and click Save.

Important: Namespace and key must match exactly, in lowercase. theme.badge works; Theme.Badge or theme.badges won’t.

Product Metafields Faith Reads Automatically

Overview

Create these product metafields to turn on the matching Faith features. You only need the ones for the features you use.

Settings

SettingsDescription
theme.badgeType: Single line text. Shows your own badge text on the product image, for example Limited edition. Turn it on in Theme settings → Product badges → Custom badge.
theme.preorder or custom.preorderType: True or false. Set to True to mark the whole product as pre-order. The button changes to Pre-order, and a badge shows. See the Pre-order article.
theme.sibling_productsType: Product (list of products). The other colors of this style, sold as separate products. See the Product Siblings articles.
theme.siblingsType: Single line text. The handle of a collection that holds all colors of this style. Used when theme.sibling_products is empty.
theme.sibling_color or custom.sibling_colorType: Single line text, Color, or a color Metaobject. This product’s color, shown as its sibling swatch, for example Navy or #1F2A44.
theme.cutlineType: Single line text. A short line above the title on product cards, for example Sand. Shows when sibling products are on. See the Cutline article.
theme.taglineType: Metaobject reference. A scrolling promotional strip on product cards, with an optional offer countdown. See Product Tagline below.
Offer deadlineType: Date or Date and time. Any product metafield you name in Theme settings → Product cards → Deadline metafield, for example custom.offer_ends_at. It shows a countdown strip on the product card.
reviews.rating and reviews.rating_countWritten by your reviews app. They show the review stars on the product page and product cards. You don’t create these yourself. See the Product Reviews article.
shopify.color-patternShopify’s Color category metafield, set when you choose a product category. Used for sibling swatch colors when no other color is set.

Product Tagline

Overview

The product tagline is a scrolling strip across the bottom of the product card image, for example Free gift with every order, with an optional offer countdown. It uses a metaobject, so one tagline can be shared by many products.

How to use

  1. Go to Settings → Custom data → Metaobjects, and click Add definition.
  2. Name it Product tagline, and add these fields, using these exact keys:
    • tagline_text: Single line text. The scrolling message.
    • offer_text: Single line text. Optional. The text shown with the countdown, for example Offer ends in.
    • offer_end_date: Date and time. Optional. When the offer ends.
  3. Click Save, then add an entry under Content → Metaobjects → Product tagline.
  4. Go to Settings → Custom data → Products → Add definition. Enter the namespace and key theme.tagline, choose Metaobject as the type, and select Product tagline.
  5. On each product, select the tagline entry, and click Save.
  6. In the theme editor, turn on Theme settings → Product cards → Show promotional tagline.

Settings

SettingsDescription
Show Promotional TaglineTheme settings → Product cards. Show the tagline strip on product cards.
Scroll SpeedTheme settings → Product cards. Set how fast the tagline scrolls.
Color SchemeTheme settings → Product cards. Select the color scheme of the tagline strip.
Tagline vs CountdownA product with a tagline shows the tagline in place of the offer countdown strip, because they share the same space.

Variant and Collection Metafields

Overview

Some Faith features read metafields on variants and collections.

Settings

SettingsDescription
Variant: theme.badgeType: JSON. A badge for one variant only, shown on top of the other badges when that variant is selected. Enter it as {“badge”: “Last pieces”, “background_color”: “#A11D1D”, “text_color”: “#FFFFFF”}. The colors are optional. Without them, the Custom badge colors are used.
Collection: theme.labelType: Single line text. A label on the collection card image, for example New or Sale.
Collection: theme.label_colorType: Color. The background color of that collection’s label. Without it, Theme settings → Collection cards → Label color is used.
Customer: BirthdayShopify’s standard customer birthday (facts.birth_date). When filled in, it shows on the customer’s Account page.

Connect Your Own Metafields

Overview

Use dynamic sources to show product-specific details, such as material, care or fit, in any text or page setting. Create the definitions you need, fill them in on each product, then connect them once in the product template. Recommended metafields:

SettingsDescription
custom.size_chartType: Page. Each product’s size chart page. Connect it to Size guide → Page content. See the Size Chart article.
custom.materialType: Single line text. For example 100% organic cotton. Connect it to a Specification row → Value in Product tabs.
custom.care_instructionsType: Multi-line text or Rich text. Connect it to a Text block inside an Accordion item, for example Care instructions.
custom.fitType: Single line text. For example Relaxed fit, true to size. Connect it to a Specification row or a Text block.
custom.short_descriptionType: Rich text. A summary separate from the full description. Connect it to Short description → Text.
custom.ship_dateType: Single line text or Date. For pre-order products. Connect it to a Text block below Buy buttons.

How to use

  1. Create the definition in Settings → Custom data → Products, and fill it in on your products.
  2. Go to Online Store → Themes → Customize, and open Products → Default product.
  3. Select the block where the value should show, for example a Text block inside an Accordion item.
  4. Next to the setting, click the Connect dynamic source icon (the stacked-disks icon).
  5. Choose your metafield from the list.
  6. Click Save, then preview a few products with and without the value.

Empty values: Faith hides blocks and rows that have no value, such as Specification rows and Accordion items. Products without the metafield simply don’t show that detail, with no empty space or placeholder.

Tip: Use Bulk edit in Shopify admin → Products to fill in metafields for many products at once. Click Columns, add your metafields, then edit them like a spreadsheet.

Was this helpful?
Previous Menu drawer Next Offer Popup