Documentation menu

Definitions reference

This page lists every definition Treadle reads, with the exact type and key. The step-by-step guides (drawings, lead times, fabrics, galleries, complete the set, dimensions) tell you when to create each one.

How to read the tables:

  • Name is what you type in the admin. You can change it.
  • Key or Type must match exactly. Shopify fills it in from the name, so check it before saving.
  • Admin type is what you pick under Select type. API type is the same type as the Admin API names it, for developers.
  • Storefronts access must be on for every definition. Without it the theme can't read the data.

Metaobject definitions #

Create these in Settings > Metafields and metaobjects, under metaobject definitions, with Add definition.

Lead time #

SettingValue
NameLead time
Typelead_time
Display nameLabel
AccessStorefronts: on
Field nameKeyAdmin typeAPI typeValidationRequired
LabellabelSingle line text, one valuesingle_line_text_fieldNoneYes
Min weeksmin_weeksIntegernumber_integerOptional: minimum 0No
Max weeksmax_weeksIntegernumber_integerOptional: minimum 0No
NotenoteMulti-line textmulti_line_text_fieldNoneNo

What the theme does with each field:

  • Label is your name for the entry, for example "Made to order, 6–8 weeks". The Delivery and assembly detail row shows it under the arrival dates, so it can carry a reason ("Built in modules, 10–12 weeks"). Where an entry has no weeks, the theme shows the label instead of dates.
  • Min weeks and Max weeks build the arrival dates shown everywhere ("Arrives 24 Nov – 8 Dec", counted from today) and the value saved on the order ("Lead time: 6–8 weeks"). A grade's Min weeks, less the product's, is the number of weeks the grade adds.
  • Note shows under the lead time when the Lead time block's "Show the lead time note" is on.

Fabric grade #

SettingValue
NameFabric grade
Typefabric_grade
Display nameName
AccessStorefronts: on
Field nameKeyAdmin typeAPI typeValidationRequired
NamenameSingle line text, one valuesingle_line_text_fieldNoneYes
Sort ordersort_orderIntegernumber_integerNoneNo
DescriptiondescriptionMulti-line textmulti_line_text_fieldNoneNo
Price noteprice_noteSingle line text, one valuesingle_line_text_fieldNoneNo
Lead timelead_timeMetaobject, one entrymetaobject_referenceMetaobject definition: Lead timeNo
  • Name is the group heading, for example "Grade B, Bouclé and weaves".
  • Sort order puts grades in order, lowest number first. A grade without a number sorts as 99. Fabrics without any grade come last.
  • Price note shows next to the grade heading in the fabric dialog and the fabric library, for example "Included" or "From +$300". In the picker on the product page, the theme shows the real price difference from your variant prices and uses the note only when it can't work one out.
  • Lead time is how long fabrics in this grade take. On a product, the grade adds its Min weeks less the product's, never less than 0 ("adds 4 weeks"). Leave it empty on grades that take no longer than your products. See how grades add weeks.

Fabric #

SettingValue
NameFabric
Typefabric (or the type set in Theme settings > Fabrics and samples > Fabric metaobject type)
Display nameName
AccessStorefronts: on
Active-draft statusOn
Field nameKeyAdmin typeAPI typeValidationRequired
NamenameSingle line text, one valuesingle_line_text_fieldNoneYes
Swatch imageswatch_imageFile, one filefile_referenceAccepted file types: ImagesYes
Swatch colorswatch_colorColorcolorNoneNo
Large imagelarge_imageFile, one filefile_referenceAccepted file types: ImagesNo
GallerygalleryFile, list of fileslist.file_referenceAccepted file types: ImagesNo
GradegradeMetaobject, one entrymetaobject_referenceMetaobject definition: Fabric gradeNo
MaterialmaterialSingle line text, one valuesingle_line_text_fieldOptional: Limit to preset choicesNo
Color familycolor_familySingle line text, list of valueslist.single_line_text_fieldOptional: Limit to preset choicesNo
FeaturesfeaturesSingle line text, list of valueslist.single_line_text_fieldOptional: Limit to preset choicesNo
CompositioncompositionSingle line text, one valuesingle_line_text_fieldNoneNo
CarecareRich textrich_text_fieldNoneNo
Lead timelead_timeMetaobject, one entrymetaobject_referenceMetaobject definition: Lead timeNo
Sample variantsample_variantProduct variant, one variantvariant_referenceNoneNo
Sort ordersort_orderIntegernumber_integerOptional: minimum 0No
  • Name is the fabric's name as shoppers see it. It must be the definition's display name: when you link a product's Fabric option to the fabric list, Shopify names each option value after the entry's display name, and the theme matches option values to fabrics by that name.
  • Swatch image is the small square in the picker, cart and product cards. Use a square photo of the cloth, at least 400 × 400 px. If you only have colors, you can untick Required and fill in Swatch color instead.
  • Large image is the preview in the fabric dialog and the fabric library, and the image that zooms. Use 2000 px or wider.
  • Gallery holds close-ups of the fabric. The product gallery can add them after the product photos.
  • Material, Color family and Features become the filter chips in the fabric dialog and the fabric library, and search terms. Preset choices keep spelling consistent, for example Color family: Neutral, White, Gray, Black, Brown, Red, Pink, Yellow, Green, Blue; Features: Performance, Pet-friendly, Outdoor, Stain-resistant.
  • Composition, for example "55% linen, 45% cotton", shows under the fabric name. If it's empty, the theme shows Material.
  • Care shows in the fabric preview and in the "Materials and care" detail row.
  • Lead time is only for a fabric that takes longer than its grade. It replaces the grade's lead time for that fabric. Leave it empty on most fabrics.
  • Sample variant is only needed when your sample product's option values don't use the same names as your fabrics. See samples.
  • Sort order sets the order of fabrics within a grade on the fabric library page, lowest number first. Fabrics without a number follow, by name. Leave the field out if alphabetical order suits you.
SettingValue
NameFabric gallery
Typefabric_gallery
Display nameLabel
AccessStorefronts: on
Field nameKeyAdmin typeAPI typeValidationRequired
FabricfabricMetaobject, one entrymetaobject_referenceMetaobject definition: FabricYes
ImagesimagesFile, list of fileslist.file_referenceAccepted file types: ImagesYes
LabellabelSingle line text, one valuesingle_line_text_fieldNoneNo

The label is for you, for example "Harlow sofa / Oat Linen". Shoppers don't see it.

Product group (complete the set) #

SettingValue
NameProduct group
Typeproduct_group
Display nameName
AccessStorefronts: on
Field nameKeyAdmin typeAPI typeValidationRequired
NamenameSingle line text, one valuesingle_line_text_fieldNoneYes
ProductsproductsProduct, list of productslist.product_referenceNoneNo

Metafield definitions #

Create these in Settings > Metafields and metaobjects > Products (or Variants) with Add definition. Type custom. followed by the key in Namespace and key.

OwnerNameNamespace and keyAdmin typeAPI typeValidationStorefrontsTier
ProductLead timecustom.lead_timeMetaobject, one entrymetaobject_referenceMetaobject definition: Lead timeOn1
VariantLead timecustom.lead_timeMetaobject, one entrymetaobject_referenceMetaobject definition: Lead timeOn1
ProductFabricscustom.fabricsMetaobject, list of entrieslist.metaobject_referenceMetaobject definition: FabricOn2
ProductFabric galleriescustom.fabric_galleriesMetaobject, list of entrieslist.metaobject_referenceMetaobject definition: Fabric galleryOn3
ProductShared imagescustom.shared_mediaFile, list of fileslist.file_referenceAccepted file types: ImagesOn3
ProductProduct groupcustom.product_groupMetaobject, one entrymetaobject_referenceMetaobject definition: Product groupOnExtra
ProductSeat heightcustom.seat_heightDimensiondimensionNoneOnExtra
ProductSeat depthcustom.seat_depthDimensiondimensionNoneOnExtra
ProductArm heightcustom.arm_heightDimensiondimensionNoneOnExtra

Notes:

  • custom.fabrics can have a different namespace and key if you set Theme settings > Fabrics and samples > Fabric list metafield to match. All other keys are fixed in version 1.0.0.
  • You don't fill in custom.fabrics by hand. Once the product's Fabric option is linked to it, Shopify keeps it in the same order as the option values and blocks direct edits. See link the Fabric option.
  • The seat measurements show only in the Dimensions detail row. See dimensions and details.

Drawing and fit metafields #

These drive the drawings, the fit checks and the title block's W × D × H. Create them in Settings > Metafields and metaobjects > Products (and Variants where the table says so), with Storefronts access. Pin the ones you fill in on most products, so they show near the top of the Metafields card.

OwnerNameNamespace and keyAdmin typeAPI typeValidation
Product and variantWidthcustom.widthDimensiondimensionNone
Product and variantDepthcustom.depthDimensiondimensionNone
Product and variantHeightcustom.heightDimensiondimensionNone
Product and variantDrawing typecustom.drawing_typeSingle line textsingle_line_text_fieldChoices: sofa, sectional, chaise, armchair, dining_chair, stool, ottoman, bench, bed, dining_table, side_table, sideboard, shelf, pendant, wall_light, table_lamp, floor_lamp, generic
ProductArm stylecustom.arm_styleSingle line textsingle_line_text_fieldChoices: square, rounded, none, track, flush, dome
ProductLeg stylecustom.leg_styleSingle line textsingle_line_text_fieldChoices: tall, short, plinth
ProductBack stylecustom.back_styleSingle line textsingle_line_text_fieldChoices: low, high
ProductBody stylecustom.body_styleSingle line textsingle_line_text_fieldChoices: straight, curved, modular
ProductCushionscustom.cushionsIntegernumber_integerMinimum 1, maximum 4
Product and variantDropcustom.dropDimensiondimensionNone
ProductShadescustom.shadesIntegernumber_integerMinimum 1, maximum 12
ProductDrawingcustom.drawingFilefile_referenceAccepted file types: Images and other files (for SVG)
Product and variantDelivery modecustom.delivery_modeSingle line textsingle_line_text_fieldChoices: whole, legs_off, modules, flat_pack
Product and variantLargest module (W × D × H)custom.largest_moduleSingle line textsingle_line_text_fieldNone
ProductFabric shown in the photoscustom.shown_fabricSingle line textsingle_line_text_fieldNone
ProductOptions shown in the photoscustom.shown_optionsSingle line text, list of valueslist.single_line_text_fieldNone

What the theme does with them:

  • Width, Depth, Height are the overall size, in any unit (the theme converts mm, cm, m, in, ft and yd). A variant's own value wins over the product's, so give each size variant its width. Without width or height, a product shows "Made to size" and has no fit check. For a pendant, the height is the shade's height.
  • Drawing type picks the silhouette and the fit check. A variant's own type wins, for a size that's a different body, such as the Corner of a sofa. Without a type, the product is drawn as a dimensioned box.
  • Arm style, Leg style, Back style, Body style, Cushions shape the silhouette. Each means something slightly different per type: on lamps and wall lights the arm style picks the shade, and dome draws a wall light's downward dome. See shape settings.
  • Drop is the distance from the ceiling to the top of a pendant's shade. Set it on each variant when the drop is an option.
  • Shades is for linear pendants. At 2 or more, the pendant is drawn as a bar canopy with that many shades hanging from it on their cords. Set the width to the bar's length, the depth to one shade's diameter and the height to one shade's height. Leave it empty for a pendant with one shade. See shades.
  • Drawing is your own SVG or image. It replaces the product page's full drawing. See your own drawing.
  • Delivery mode and Largest module say how a piece arrives, for the doorway check. With modules, flat_pack or legs_off and a largest part such as 105 × 105 × 70 (cm, width × depth × height), the check uses that part and says so: "Arrives in modules · each fits through your 80 cm doorway". Without them the piece is checked whole.
  • Fabric shown in the photos is the fabric the product's general photos show, by name, for example Cream Bouclé. While a shopper has another fabric selected, the photo says "Shown in Cream Bouclé", with the price difference when that fabric is in another grade ("Shown in Cream Bouclé · +$300"). A To scale row for a product without a fabric option orders a sample of this fabric.
  • Options shown in the photos lists the option values the photos show, for example 2-seater, 180 cm. While the selection differs, the photo says "Shown: 2-seater, 180 cm". A variant with its own image switches the photo instead.

Review metafields #

Reviews apps fill these in. You don't create them. See reviews.

OwnerNamespace and keyAPI typeRead by
Productreviews.ratingratingThe Rating block's stars and value
Productreviews.rating_countnumber_integerThe Rating block's review count

Data the theme writes to carts and orders #

WhatWhere it showsControlled by
Line item property Lead time, for example "6–8 weeks", including the weeks a slower grade addsCheckout, the order in your admin, order emails if you add the snippetTheme settings > Lead times > Save lead time on the order: Visible at checkout (Lead time)
Line item property _lead_timeThe order in your admin onlySame setting: Admin only (_lead_time)
Cart attribute Longest lead timeThe order in your admin (Additional details), order emails with the snippetTheme settings > Lead times > Save the longest lead time on the order

The cart and the cart drawer show arrival dates worked out from your current data, not the value saved when the item was added. If you change a lead time, carts update on their next view. The cart attribute follows.