Skip to content

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.HANDLE and bracket-notation lookups;
  • metaobject_definition.values loops and pagination;
  • metafield values that reference a metaobject; and
  • the metaobject root 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

PropertyDescription
metaobject.fieldsAuthored metaobject fields as key/type/value entries.
metaobject.handleURL-safe unique slug.
metaobject.idUnique identifier.
metaobject.nameName.
metaobject.seo_descriptionSEO description of a web-renderable metaobject entry.
metaobject.seo_titleSEO title of a web-renderable metaobject entry.
metaobject.systemReserved system identity object containing id, handle, type, and a normalized storefront URL.
metaobject.typeMetaobject definition type handle.
metaobject.urlRelative 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.