{{ data }} plus the stored field value types (text, date, toggle, dictionary, fieldset, and more). A custom field may also hold a Content object.
{{ data }} holds the custom field values on an owner such as an entity. Those fields are also properties of the owner, so {{ article.hero }} and {{ article.data.hero }} are the same value. Use .data when you need the bag itself.
A custom field value is polymorphic. Use object_type to tell which implementing type you have. This page catalogs {{ data }} and the dedicated stored-value types. A field can also hold a Content object (for example {{ entity }}, {{ article }}, or {{ image }}); those stay documented under Content.
These stored-value types are distinct from Simple Object Types (string, number, boolean) and from Form Fields used to render HTML controls.
Fieldsets group related child values on one owning entity, either as a single composite or as a repeating list of child objects. Access known field_ids, guard optional content with is_valid, and iterate repeating entries; do not output the whole fieldset as page content.
Which of those two shapes you have is set by the field definition and reported by allow_multiple. When allow_multiple is false the fieldset holds one child object: read its known field_ids directly, or walk fields. When allow_multiple is true it holds an ordered list: iterate the fieldset itself or objects, and treat each entry as one child object carrying the configured child fields, not as another fieldset. Editors can reorder the entries of a repeating fieldset, so render them in the order they arrive rather than assuming a fixed position for any one entry. The kinds of link a Type `url` field can hold, and how an entity link keeps the URL it was saved with, are covered on the url field type page — not restated here.
Field values in conditions A custom field is an object, not a bare value, and that matters in {% if %}: • A checkbox field object is always truthy. Test entity.featured.checked, not entity.featured. • Compare a field's value, not the field: {% if entity.layout.value == "wide" %}. Comparing the object itself to a string never matches. • Two field objects are equal only when they are the same object, so comparing two different fields' objects is almost never what you meant; compare their .value instead. Comparing an entity to an entity ({% if item == entity %}) does compare identity and is valid. • Guard an optional field with its own is_valid: {% if article.summary_html.is_valid %}…{% endif %}.
Picker list values A picker list field (datastoreitemlist, articlelist, entitylist, taglist, and the other *list types) holds the selected objects in editor order and can be used directly: test is_valid, read size, take | first, and loop over it with {% for %}. Each item is the selected object itself, so its title, full_url, and custom fields read the same as anywhere else. No .items or .objects step is needed.
{{ data }}
The bag of custom field values on an owner such as an entity. Custom fields are also exposed as properties of that owner, so article.hero and article.data.hero are the same value. Use .data when you need the bag itself (enumerate, copy, or inspect).
Will be true if data contains one or more custom properties
*
object
A custom field value accessed by field_id, using data.field_id or data['field-id']. Each value is one of the stored-value types on this page, or a Content object such as an entity or image
JSON representation of the current data object, identical to {{ data | inspect: 4, false }}
Prefer the promoted properties on the owner for ordinary output. {% for value in data %} walks the custom field values, not the field_id names. Data objects are copyable using the {% copy_to_dictionary %} method; the keys are field_ids and the values are the corresponding field value objects. Some non-entity objects also expose a data bag of named custom values.
Examplearticle.hero and article.data.hero are the same valueCustom fields are exposed both as direct properties on their owner and as entries in the owner's data bag by field_id. Use the direct property for ordinary output; use .data when you need the bag itself, such as looking up a field_id that is only known at render time.
Liquid
{%- if article.hero == article.data.hero -%}
<p>Same value, read two ways.</p>
{%- endif -%}
{%- if article.data.is_valid -%}
{%- assign lookup_id = "hero" -%}
{%- if article.data[lookup_id].is_valid -%}
{{ article.data[lookup_id] }}
{%- endif -%}
{%- endif -%}
The raw unencoded value of the field - outputting the raw value may have unexpected results if the value contains any HTML characters (ie: <, >, ', or ")
The html encoded text of the field. Line breaks in the textarea are converted to "<br />" tags. May include additional markup in the editor preview to make it easier to edit content
Allows any input, but encodes it as text prior to displaying it.
ExampleOutput an entity textarea fieldOutput or validate an entity textarea field value; check is_valid when the field may be empty.
The raw stored value of the field, which is a JSON array string such as ["first","second"]. For textlist fields you do not typically care about this - use values or iterate the field instead
The values of this field joined together with a comma and a space. May include additional markup in the editor preview to make it easier to edit content
Field containing multiple text values stored in one field, such as a list of email addresses. The field is itself a list of strings: iterate it with a {% for %} loop, index it directly with textlist[0], and use the list symbols first, last, and size on it. Iterating the field yields the same strings as values, so reach for values only when you want the list as its own object. Guard optional content with is_valid, or check count, before rendering. The field definition decides how many values an editor may enter and may drop duplicate entries, but at runtime the field simply exposes the values that were saved.
Delimited string containing the values from all of the selected options. For select fields you do not typically care about this - use selected or values instead
The default value for this field if no value is specified
options
object
Contains all of the available options for this select list. Each option is a property on the object where they property key is the option value and the property value is the option text
String containing the text from all of the selected options. May include additional markup in the editor preview to make it easier to edit content
Represents the selection from a select list. The select list may or may not allow multiple selections (defaults to only allow a single selection).
ExampleRead the selected options from select and checkboxlist fieldsselect and checkboxlist share the same options/selected/values/count shape. select holds a single-choice (or multi-choice) list; checkboxlist always holds multiple true/false checkboxes.
entity.status.values is a list of the selected option text (entity.status.selected holds the underlying values instead). is_valid guards against no option being selected.
Checkboxlist field: count and list the checked options
Liquid
{%- if entity.interests.count > 0 -%}
<p>{{ entity.interests.count }} interest{% if entity.interests.count != 1 %}s{% endif %} selected:</p>
<ul>
{%- for interest in entity.interests.values -%}
<li>{{ interest }}</li>
{%- endfor -%}
</ul>
{%- endif -%}
Delimited string containing the values from all of the checked checkboxes. For checkboxlist fields you do not typically care about this - use selected or values instead
The default value for this field if no value is specified
options
object
Contains all of the available options for this checkboxlist. Each option is a property on the object where they property key is the option value and the property value is the option text
String containing the text from all of the checked checkboxes. May include additional markup in the editor preview to make it easier to edit content
ExampleRead the selected options from select and checkboxlist fieldsselect and checkboxlist share the same options/selected/values/count shape. select holds a single-choice (or multi-choice) list; checkboxlist always holds multiple true/false checkboxes.
entity.status.values is a list of the selected option text (entity.status.selected holds the underlying values instead). is_valid guards against no option being selected.
Checkboxlist field: count and list the checked options
Liquid
{%- if entity.interests.count > 0 -%}
<p>{{ entity.interests.count }} interest{% if entity.interests.count != 1 %}s{% endif %} selected:</p>
<ul>
{%- for interest in entity.interests.values -%}
<li>{{ interest }}</li>
{%- endfor -%}
</ul>
{%- endif -%}
Same as value - except that output is clickable in the preview site while value is not. May include additional markup in the editor preview to make it easier to edit content
Allows any valid HTML input. May also include <liquid-markup> tags.
ExampleBranch on object_type to handle code and html fields differentlycode and html are both raw, unvalidated text, but their extra properties differ: code exposes code_type (js, css, less, scss, or liquid); html exposes plain_value (never evaluated) and interpreted_value (liquid-markup tags evaluated on every reference). Use object_type to tell which one a field holds.
The value as it was input by the user, which is the same as the value property. May include additional markup in the editor preview to make it easier to edit content
Contains code - which may be any of CSS, Javascript, Liquid Markup, JSON objects, or any other type of code. This code is not evaluated or processed before being output. Use with extreme caution.
ExampleBranch on object_type to handle code and html fields differentlycode and html are both raw, unvalidated text, but their extra properties differ: code exposes code_type (js, css, less, scss, or liquid); html exposes plain_value (never evaluated) and interpreted_value (liquid-markup tags evaluated on every reference). Use object_type to tell which one a field holds.
A comma-delimited list of all of the key-value pairs in this field using the form "key1:value1,key2:value2,etc..." For labels fields you do not typically care about this - use values instead
Same as value. May include additional markup in the editor preview to make it easier to edit content
Field containing a list of key-value pairs where the keys are not necessarily unique. You may also treat this object as a list containing all of the key-value pairs which may be iterated using a {% for %} loop. For more details, see the examples below:
ExampleList all keys, values, and objects in fieldsIterate over dictionary fields (keys/values), labels fields (Key/Value pairs), and fieldset fields (objects or individual values). See also list-all-cookies and list-all-custom-properties for related patterns.
Dictionary field: keys and values
Liquid
<ul>
{%- for key in entity.dictionary_field %} --equivalent to {% for key in entity.dictionary_field.keys -%}
<li><strong>{{key}}</strong> = {{entity.dictionary_field.values[key]}}</li>
{%- endfor -%}
</ul>
Labels field: keys and values
Liquid
<ul>
{%- for kvp in entity.labels -%}
<li><strong>{{kvp.Key}}</strong> = {{kvp.Value}}</li>
{%- endfor -%}
</ul>
Fieldset field: all objects
Liquid
{%- if entity.fieldset.is_valid and entity.fieldset.allow_multiple -%}
<ul>
{%- for object in entity.fieldset %} --equivalent to {% for object in entity.fieldset.objects -%}
<li><strong>{{ object.custom_title }}</strong>{% if object.custom_description.is_valid %}<br />
{{- object.custom_description }}{% endif %}</li>
{%- endfor -%}
</ul>
{%- endif -%}
Fieldset field: all values
Liquid
{%- if entity.fieldset.is_valid -%}
{%- unless entity.fieldset.allow_multiple -%}
<ul>
{%- for field in entity.fieldset %} --equivalent to {% for field in entity.fieldset.fields -%}
<li><strong>{{field.field_id}}</strong> = {{field.output}}</li>
{%- endfor -%}
</ul>
{%- endunless -%}
{%- endif -%}
{{ fieldset }}
A group of related child fields exposed as either one structured custom object or a repeating list of child custom objects.
True when the fieldset is repeating. A repeating fieldset exposes child custom objects through objects and iteration; a non-repeating fieldset exposes one custom object through fields and direct child access.
An inspection representation of the fieldset. Render the relevant child fields or child custom objects for production output.. May include additional markup in the editor preview to make it easier to edit content
A fieldset keeps related values together inside one owning entity. When allow_multiple is false, access known child FieldIDs directly (object.keyName or object["keyName"]) or through fields (object.fields.keyName or object.fields["keyName"]); iterating the fieldset or fields yields the individual child field objects. When allow_multiple is true, iterate the fieldset or objects to receive one child custom object per entry, then access that object's named child fields. A repeated item is a child custom object, not another fieldset. Guard optional content with is_valid before rendering. Use inspect during development when the runtime shape is unfamiliar, but do not use the fieldset's raw inspection representation as the production UI.
ExampleAccess fields in a single-object fieldsetGuard a non-repeating fieldset, then access known child FieldIDs directly, through fields, or with bracket notation.
Access a known child directly
Liquid
{%- if entity.fieldset.is_valid and entity.fieldset.field1.is_valid -%}
<p>Field 1 Value: {{ entity.fieldset.field1 }}</p>
{%- endif -%}
For a non-repeating fieldset, a known child FieldID can be accessed directly. The selected value remains its documented child field type.
Access a child through fields
Liquid
{%- if entity.fieldset.is_valid and entity.fieldset.fields.field2.is_valid -%}
<p>Field 2 Value: {{ entity.fieldset.fields.field2 }}</p>
{%- endif -%}
The fields property makes the single-object shape explicit while returning the same documented child field type.
Use bracket notation when needed
Liquid
{%- if entity.fieldset.is_valid and entity.fieldset['field-with-hyphens'].is_valid -%}
<p>Field Value: {{ entity.fieldset['field-with-hyphens'] }}</p>
{%- endif -%}
Use bracket notation when a FieldID is not suitable for dot notation. The selected value still keeps its documented child field type.
ExampleRender repeating fieldset objectsGuard a repeating fieldset, iterate its child custom objects, and render named child fields from each entry.
Liquid
{%- if entity.whyus_reasons.is_valid -%}
<ul>
{%- for reason in entity.whyus_reasons -%}
<li>
<strong>{{ reason.title }}</strong>
{%- if reason.description.is_valid -%}
<div>{{ reason.description }}</div>
{%- endif -%}
</li>
{%- endfor -%}
</ul>
{%- endif -%}
ExampleInspect a fieldset during developmentUse bounded inspection to understand or troubleshoot an unfamiliar fieldset before writing intentional child-field output.
ExampleList all keys, values, and objects in fieldsIterate over dictionary fields (keys/values), labels fields (Key/Value pairs), and fieldset fields (objects or individual values). See also list-all-cookies and list-all-custom-properties for related patterns.
Dictionary field: keys and values
Liquid
<ul>
{%- for key in entity.dictionary_field %} --equivalent to {% for key in entity.dictionary_field.keys -%}
<li><strong>{{key}}</strong> = {{entity.dictionary_field.values[key]}}</li>
{%- endfor -%}
</ul>
Labels field: keys and values
Liquid
<ul>
{%- for kvp in entity.labels -%}
<li><strong>{{kvp.Key}}</strong> = {{kvp.Value}}</li>
{%- endfor -%}
</ul>
Fieldset field: all objects
Liquid
{%- if entity.fieldset.is_valid and entity.fieldset.allow_multiple -%}
<ul>
{%- for object in entity.fieldset %} --equivalent to {% for object in entity.fieldset.objects -%}
<li><strong>{{ object.custom_title }}</strong>{% if object.custom_description.is_valid %}<br />
{{- object.custom_description }}{% endif %}</li>
{%- endfor -%}
</ul>
{%- endif -%}
Fieldset field: all values
Liquid
{%- if entity.fieldset.is_valid -%}
{%- unless entity.fieldset.allow_multiple -%}
<ul>
{%- for field in entity.fieldset %} --equivalent to {% for field in entity.fieldset.fields -%}
<li><strong>{{field.field_id}}</strong> = {{field.output}}</li>
{%- endfor -%}
</ul>
{%- endunless -%}
{%- endif -%}
{{ dictionary }}
Object containing a list of key-value pairs where the keys are unique.
True if properties can be added or removed from this dictionary. This will only be true if the dictionary was created using the {% create_dictionary %} method
The JSON representation of the values. May include additional markup in the editor preview to make it easier to edit content
Individual dictionary values may be accessed using the {{ dictionary.keyName }}, {{ dictionary["keyName"] }}, {{ dictionary.values.keyName }}, or dictionary.values["keyName"] syntax. You may also treat this object as a list containing all of the keys which may be iterated using a {% for %} loop.
ExampleList all keys, values, and objects in fieldsIterate over dictionary fields (keys/values), labels fields (Key/Value pairs), and fieldset fields (objects or individual values). See also list-all-cookies and list-all-custom-properties for related patterns.
Dictionary field: keys and values
Liquid
<ul>
{%- for key in entity.dictionary_field %} --equivalent to {% for key in entity.dictionary_field.keys -%}
<li><strong>{{key}}</strong> = {{entity.dictionary_field.values[key]}}</li>
{%- endfor -%}
</ul>
Labels field: keys and values
Liquid
<ul>
{%- for kvp in entity.labels -%}
<li><strong>{{kvp.Key}}</strong> = {{kvp.Value}}</li>
{%- endfor -%}
</ul>
Fieldset field: all objects
Liquid
{%- if entity.fieldset.is_valid and entity.fieldset.allow_multiple -%}
<ul>
{%- for object in entity.fieldset %} --equivalent to {% for object in entity.fieldset.objects -%}
<li><strong>{{ object.custom_title }}</strong>{% if object.custom_description.is_valid %}<br />
{{- object.custom_description }}{% endif %}</li>
{%- endfor -%}
</ul>
{%- endif -%}
Fieldset field: all values
Liquid
{%- if entity.fieldset.is_valid -%}
{%- unless entity.fieldset.allow_multiple -%}
<ul>
{%- for field in entity.fieldset %} --equivalent to {% for field in entity.fieldset.fields -%}
<li><strong>{{field.field_id}}</strong> = {{field.output}}</li>
{%- endfor -%}
</ul>
{%- endunless -%}
{%- endif -%}
ExampleCreate a settings dictionary (key-value map)Build a settings dictionary (key-value map) and use it for configuration or display.
ExampleReference dictionary field properties in multiple waysReference dictionary field properties with dot notation, bracket notation, or keys/values iteration.
<ul>
{%- for field in entity.dictionary_field.keys -%}
<li><strong>{{ field }}</strong> = {{ entity.dictionary_field.values[field] }}</li>
{%- endfor -%}
</ul>
Output an unordered list containing all of the dictionary field properties and their values by enumerating the keys property.
List all dictionary fields from the dictionary object
Liquid
<ul>
{%- for field in entity.dictionary_field -%}
<li><strong>{{ field }}</strong> = {{ entity.dictionary_field[field] }}</li>
{%- endfor -%}
</ul>
Directly enumerating the dictionary object is the same as enumerating the keys property, so this example is functionally identical to the previous example.
The value formatted using the "Short date pattern" (MM/dd/yyyy). May include additional markup in the editor preview to make it easier to edit content
Field used to store a date. All dates are stored in UTC time.
ExampleUse a post_date or date-time field with the date filterUse a post_date or other date-time field and format or compare it with the date filter and date properties.
Liquid
{%- if entity.rehearsal_start.is_valid -%}
<p>Rehearsal will begin on {{ entity.rehearsal_start | date: "MMMM dd, yyyy 'at' h:m t" }} UTC</p>
{%- endif -%}
Delimited string containing the values from all of the selected options. For objecttype fields you do not typically care about this - use values instead
String containing the text from all of the selected options. May include additional markup in the editor preview to make it easier to edit content
Represents the selection of one or more object types from a list. The list may or may not allow multiple selections.
ExampleRead the object types selected by an objecttype fieldobjecttype represents the selection of one or more object types from a list, using the same values/count shape as select and checkboxlist. options lists every available object type; values lists the ones actually selected.
Liquid
{%- if entity.related_kinds.is_valid -%}
<p>Applies to {{ entity.related_kinds.count }} object type{% if entity.related_kinds.count != 1 %}s{% endif %}: {{ entity.related_kinds.values | join: ", " }}</p>
{%- endif -%}