Documentation Index
Fetch the complete documentation index at: https://docs.launchmystore.io/llms.txt
Use this file to discover all available pages before exploring further.
Metafields in Aqua / Liquid
Every owner that supports metafields exposes ametafields drop on its
Aqua/Liquid object. Access follows the standard
{owner}.metafields.{namespace}.{key} pattern, so theme code that reads
metafields stays portable.
For the full data model (types, owners, validations, REST API), see
Metafields Overview.
The basic pattern
{{ … }} triggers toString() on the metafield drop, which renders
type-aware (see render rules below). .value
returns the decoded value (number, array, object, …). .type returns
the type string.
Missing namespaces and missing keys return an empty drop — {{ … }}
prints empty string, {% if … %} is falsy, no exception is thrown.
This makes it safe to reference fields that may not exist on every
resource.
Owners
| Owner | Drop |
|---|---|
| Account / store | shop.metafields |
| Product | product.metafields |
| Variant | variant.metafields |
| Collection | collection.metafields |
| Customer | customer.metafields |
| Order | order.metafields |
| Page | page.metafields |
| Blog | blog.metafields |
| Article | article.metafields |
Render rules per type
{{ metafield }} (without .value) calls a type-aware toString:
| Type | {{ mf }} renders | {{ mf.value }} returns |
|---|---|---|
single_line_text_field / multi_line_text_field | string | string |
rich_text_field (alias rich_text) | raw HTML, unescaped | raw HTML string |
number_integer | integer | number |
number_decimal | decimal | number |
boolean | "true" or "false" | bool |
color | "#RRGGBB" | string |
date / date_time | ISO string | string |
url | URL string | string |
weight / dimension / volume | "<value> <unit>" | { unit, value } |
money | {amount, currency_code} (use | money filter) | object |
rating | {value, scale_min, scale_max} | object |
file_reference | URL string | URL string |
*_reference (other) | id string | id string (or resolved drop, if resolver wired) |
list.* | iterable array of value-drops | array |
json / json_string | stringified JSON | parsed value |
Examples
Text and numbers
Rich text (HTML)
Therich_text_field type renders the stored HTML unescaped — perfect
for care instructions, warnings, formatted descriptions:
Boolean conditionals
Lists
Money
Measurements
Color
Date
Reference (file)
JSON
Defensive access
Use{% if %} to guard optional fields — missing keys are falsy:
default:
Across owner types
Same access pattern, every owner:Performance
Metafields are bulk-loaded server-side alongside the parent resource — one query loads the resource, one query loads all its metafields, and both are cached together underg:{storeId}:{type}:{handle} (24h TTL).
There is no per-field network round-trip from Liquid.
When a metafield is written via the REST API, the cache invalidation
chain fires automatically (Redis g:{storeId}:* SCAN+DEL + a fire-and-
forget POST to the storefront’s /api/internal/invalidate-page-cache
endpoint). The next render sees the new value within ~1 second.
See also
- Metafields Overview — types, owners, REST API
- Create / Upsert Metafield — write from your app
- Aqua Filters —
money,date,default, etc.