metaobject
An entry of a custom content definition (metaobject). Read an authored field by
its definition key, for example metaobject.material.value, or iterate
metaobject.fields; each item has key, type, and value. An unknown,
non-authored top-level property resolves to nil and never falls through to
backend row state.
Available in
metaobjects.TYPE.HANDLEand bracket-notation lookups;metaobject_definition.valuesloops and pagination;- metafield values that reference a metaobject; and
- the
metaobjectroot while rendering a published metaobject web-page template.
Only storefront-visible entries are returned. Publish status is enforced for
definitions that enable the publishable capability; non-publishable definitions
do not have a draft/published lifecycle. Missing and cross-store entries resolve
to nil. The global metaobjects[type] lookup rejects app-owned app-- types;
referenced entries retain their normal storefront-visibility checks.
Examples
Read authored fields
{% assign cotton = metaobjects['material']['cotton'] %}{% if cotton %} <h2>{{ cotton.name }}</h2> <p>{{ cotton.description.value }}</p>{% endif %}Example output:
<h2>Organic cotton</h2><p>Soft, breathable and responsibly sourced.</p>Keep authored fields separate from system identity
Use system whenever an authored field could be named id, handle, type,
or url:
Entry handle: {{ metaobject.system.handle }}Authored handle label: {{ metaobject['handle'].value }}Storefront URL: {{ metaobject.system.url | default: metaobject.url }}system.url/metaobject.url is normalized to a storefront-relative URL. An
explicit HTTP(S) URL contributes its path, query, and fragment; otherwise the
Drop uses /metaobjects/TYPE/HANDLE. The page route still requires the
definition’s online-store capability, so data-only definitions should not be
linked as pages.
Iterate authored fields
<dl> {% for field in metaobject.fields %} <dt>{{ field.key }}</dt> <dd>{{ field.value.value }}</dd> {% endfor %}</dl>An unknown top-level field returns nil; it never exposes model timestamps,
store IDs, GORM fields, or unpublished definition state.
Properties
| Property | Description |
|---|---|
metaobject.fields | Authored metaobject fields as key/type/value entries. |
metaobject.handle | URL-safe unique slug. |
metaobject.id | Unique identifier. |
metaobject.name | Name. |
metaobject.seo_description | SEO description of a web-renderable metaobject entry. |
metaobject.seo_title | SEO title of a web-renderable metaobject entry. |
metaobject.system | Reserved system identity object containing id, handle, type, and a normalized storefront URL. |
metaobject.type | Metaobject definition type handle. |
metaobject.url | Relative URL of the resource. |
Property list is generated from the storefront engine (MetaobjectEntryDrop), so it always matches what your theme can use. Use {{ metaobject | json }} only as a curated debug snapshot; it can omit lazy or otherwise public properties.