PigmentDocumentation

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

KeyTypeUse
custom.background_colorColorThe dark color of the product. Every page, tile and section that shows the product.
custom.background_color_endColorThe light color of the product. Without it the theme derives it from the dark one.
custom.cutoutFile (image)The product standing, on a transparent background, cropped tight. Without it the featured image is used.
custom.name_linesSingle line textThe name in lines, separated by |, for example Lavender|Night|Renewal. Hero sequence, the product page, tiles.
custom.volumeSingle line textThe format, for example 50 ml. Hero sequence, Color library, Line-up, index rows.
custom.taglineSingle line textA 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_productProductThe product Next product opens on the product page. Without it, the next one in the collection.
custom.story_imageFile (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_headingSingle line textThe heading of the product page's Campaign.
custom.story_textMulti-line textThe text of the product page's Campaign.
custom.primary_collectionCollectionThe collection of the breadcrumb and of Next product.
custom.badge_labelSingle line textThe text of the custom badge.
custom.skin_typeSingle line textPassport row Suited to; Compare products.
custom.skin_feelSingle line textPassport row Skin feel; Texture, Skin feel.
custom.key_ingredientsSingle line textPassport row Key ingredients.
custom.textureSingle line textPassport row Texture; Texture, the heading and the choice of its illustration.
custom.texture_imageFile (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.aromaSingle line textPassport row Aroma.
custom.dosageSingle line textPassport row Dosage.
custom.how_to_useMulti-line textThe How to use row of the product page; Texture, How to use.
custom.ingredientsMulti-line textThe Ingredients row of the product page.
custom.ratingRating, or decimal numberThe rating out of 5, when no review app writes reviews.rating.
custom.rating_countIntegerThe number of reviews, when no review app writes reviews.rating_count.

Variants

KeyTypeUse
custom.background_colorColorThe dark color of a variant that differs from its product: choosing it recolors the page.
custom.background_color_endColorThe light color of that variant.
custom.cutoutFile (image)The cutout of that variant on the product page.

Collections

KeyTypeUse
custom.background_colorColorThe dark color of the collection: its head and its tile.
custom.background_color_endColorThe light color of the collection.
custom.banner_imageFile (image)The banner of the collection page, before the Banner image of the section.

Articles (blog posts)

KeyTypeUse
custom.productProductThe product of the article: its colors, its cutout, and its tile on the article page.
custom.reading_timeIntegerThe reading time in minutes. Without it, worked out from the length of the article.

Pages

KeyTypeUse
custom.imageFile (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.

WhereWhat to typeMetafield type
Theme settings, Quick view: Short description metafieldFor example custom.short_descriptionSingle 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 MetafieldThe name, for example Texture, or the key, for example custom.textureAny 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.