Skip to content

code

Custom field type

All field types

Source code edited in a code editor, stored verbatim.

Written as
"Type": "code"
Valid on
Template fields, Datastore schema, and custom site settings
Stores
{{ code }} — the Liquid object a template reads from this field.
Validators
same, not, maxlength, eq, different
Default value
A source string.

Properties

Accepted in addition to the shared properties every definition carries.

Property Required Description
CodeType Which language the editor highlights.
  • js
  • css
  • less
  • scss
  • liquid