Metafields
Metafields give each product, variant, collection and article its own colors, cutout and texts. This page lists every metafield Pigment reads, with its key and its type.
Create each definition in your admin, under Settings, Custom data, then choose the owner (Products,
Variants, Collections, Blog posts or Pages) and type the namespace and key exactly as shown: custom is the
namespace. Then fill the values on each product, collection or article. A metafield left empty shows nothing, or the
fallback described below.
The two colors
The dark color (custom.background_color) and the light color (custom.background_color_end)
are the heart of the theme: from them it works out the light ground, the text, the dark ground and the paper of every
page and section that shows the product, with the contrast checked. Pick the dark color deep enough to carry white text,
and the light one as the color of the product itself.
The cutout
Upload a PNG of the product standing upright on a transparent background, cropped tight to the product, about 450 by 1100 pixels for a tube. It stands in the hero, the bands, the line-up and the product page. Without it the featured image of the product is used, which looks best when it is also a cutout.
Products
| Key | Type | Use |
|---|---|---|
custom.background_color | Color | The dark color of the product. Every page, tile and section that shows the product. |
custom.background_color_end | Color | The light color of the product. Without it the theme derives it from the dark one. |
custom.cutout | File (image) | The product standing, on a transparent background, cropped tight. Without it the featured image is used. |
custom.name_lines | Single line text | The name in lines, separated by |, for example Lavender|Night|Renewal. Hero sequence, the product page, tiles. |
custom.volume | Single line text | The format, for example 50 ml. Hero sequence, Color library, Line-up, index rows. |
custom.tagline | Single line text | A short description. Hero sequence (its first sentence), Color library, Hue finder, and the Text block of the product page with its Source on Tagline. |
custom.next_product | Product | The product Next product opens on the product page. Without it, the next one in the collection. |
custom.story_image | File (image) | The photo of the product page's Campaign. A product without it does not show the section (Hide when the image is empty). |
custom.story_heading | Single line text | The heading of the product page's Campaign. |
custom.story_text | Multi-line text | The text of the product page's Campaign. |
custom.primary_collection | Collection | The collection of the breadcrumb and of Next product. |
custom.badge_label | Single line text | The text of the custom badge. |
custom.skin_type | Single line text | Passport row Suited to; Compare products. |
custom.skin_feel | Single line text | Passport row Skin feel; Texture, Skin feel. |
custom.key_ingredients | Single line text | Passport row Key ingredients. |
custom.texture | Single line text | Passport row Texture; Texture, the heading and the choice of its illustration. |
custom.texture_image | File (image) | A photo of the texture, cut out on a transparent background. Texture shows it, large and centered, when its Source is on Automatic; without it, the illustration. |
custom.aroma | Single line text | Passport row Aroma. |
custom.dosage | Single line text | Passport row Dosage. |
custom.how_to_use | Multi-line text | The How to use row of the product page; Texture, How to use. |
custom.ingredients | Multi-line text | The Ingredients row of the product page. |
custom.rating | Rating, or decimal number | The rating out of 5, when no review app writes reviews.rating. |
custom.rating_count | Integer | The number of reviews, when no review app writes reviews.rating_count. |
Variants
| Key | Type | Use |
|---|---|---|
custom.background_color | Color | The dark color of a variant that differs from its product: choosing it recolors the page. |
custom.background_color_end | Color | The light color of that variant. |
custom.cutout | File (image) | The cutout of that variant on the product page. |
Collections
| Key | Type | Use |
|---|---|---|
custom.background_color | Color | The dark color of the collection: its head and its tile. |
custom.background_color_end | Color | The light color of the collection. |
custom.banner_image | File (image) | The banner of the collection page, before the Banner image of the section. |
Articles (blog posts)
| Key | Type | Use |
|---|---|---|
custom.product | Product | The product of the article: its colors, its cutout, and its tile on the article page. |
custom.reading_time | Integer | The reading time in minutes. Without it, worked out from the length of the article. |
Pages
| Key | Type | Use |
|---|---|---|
custom.image | File (image) | The picture of a page in the cards of a mega menu. |
Ratings
The Rating block of the product page, the quick view, Compare products and the collection tiles (with Show the
product rating on) read the standard
reviews.rating and reviews.rating_count metafields first: review apps write them for you. Without
them they read custom.rating and custom.rating_count, which you fill yourself. Without either,
no rating is shown.
Connecting a setting to a metafield
A text setting of a block or a section can show a metafield instead of a fixed text: select the dynamic source icon next to the setting in the theme editor and pick the metafield. The definition has to exist first. The demo product template is already connected to the keys above for the passport, the How to use and Ingredients rows and the Texture section.
Metafields you type by key
A few settings are text fields where you type the namespace.key yourself instead of using the dynamic
source icon.
| Where | What to type | Metafield type |
|---|---|---|
| Theme settings, Quick view: Short description metafield | For example custom.short_description | Single line or multi-line text on products. Without it, quick view shows the first paragraph of the description. |
| Compare products, Row block: Metafield, with Source on Metafield | The name, for example Texture, or the key, for example custom.texture | Any type: each one is drawn as such. See Compare products rows. |
Product list metafields
The Products setting of the Product upsell block, of the Complementary products block and of the cart recommendations can be connected to a product metafield of type Product, set to accept a list of products, so each product carries its own selection. Products come from must then be on A manual selection.
Compare products rows
Each Row block of Compare products with Source on Metafield reads the product metafield you name in
its Metafield setting, on every compared product. Type the name of the metafield, exactly as it shows in
Settings, Custom data, Products (Skin type
), or its key (custom.skin_type). The field
takes no dynamic source on purpose: a connected metafield would give the value of the product of the page in every
column. Every type is drawn as such: true or false as icons, a list as a sentence, a number with the row's
Unit, a rating out of its scale, a color with its swatch, a reference by its title. A product without a
value shows a hyphen. The other sources (Vendor, Product type, Tags, SKU, Barcode, Weight and Unit price) read the
product's own fields.
Settings that cannot be connected
Shopify allows connections on colors, texts, rich texts, images, videos, links, pages, collections, products and metaobjects only. Sliders, checkboxes, dropdowns, the color scheme and Liquid code are the same for the whole template. When one product needs a different value for one of those, give it a second product template.