Skip to content

Developers · Liquid

Liquid Objects Introduction

Last updated 1 November 2026

What Liquid objects are on Insites, with the context object and a live example.

An object holds data your template can read. You read a value with a dot, as in {{ object.property }}. On Insites, the most important object is context. It is available in every Liquid file. It holds the request, the signed-in user, the session, constants and more.

The two groups of objects

PageCovers
Liquid objects: detailsThe standard objects inside loops, such as forloop and tablerowloop, with the index, position and count of the current item
Liquid objects: InsitesThe context object, available in pages, partials, layouts and notifications

Example: read from context

insites-cli exec liquid docs57 "{{ context.environment }}|{{ context.current_user | json }}|{{ context.language }}"
production|null|en

This ran on the docs.insites.io instance on 1 November 2026. The run had no signed-in user, so context.current_user is null.

Commonly used parts of context

ValueHolds
context.paramsThe request parameters, from the address and the form body
context.current_userThe signed-in user, or null
context.sessionValues stored for this visitor between requests
context.constantsConstants set on the instance, such as API keys
context.locationThe address of the request
context.flashOne-time messages, such as context.flash.notice
context.environmentThe environment name, such as production or staging

Common mistakes

  • Printing a constant on a page or into the log while you debug. Constants hold secrets.
  • Assuming context.current_user exists. Check it is not blank before you read from it.
  • Trusting context.params. Anyone can send any value; check it before you use it.