Nimbu Developer Docs
Themes

Liquid Context & Data Drops

Reference for every global variable and drop injected into Liquid during Nimbu theme rendering.

Quick Reference of Global Variables

KeyDescription
siteCurrent site object exposing channels, products, settings, analytics flags, and helper methods.
template / template_nameSlugified identifiers for the active template (path-based and sanitized filename).
theme_versionVersion string of the active theme record. Useful for cache busting.
now (Time)Current UTC timestamp at render.
today (Date)Current site-local date.
paramsSanitized request params (strings, arrays, hashes) excluding reserved keys (splat, captures).
pathResolved request path; honours simulator overrides.
locale, default_locale, locale_url_prefixCurrent locale, default locale, and prefix (e.g. /fr).
seo.description, seo.keywordsSite-level SEO fallbacks.
auth_tokenAuthenticity token required by form helpers.
customerLogged-in customer drop, if any.
cartCurrent order drop (open checkout) if session exists.
flashFlash messages merged from the main session and addon_flash.

Config Drop

config surfaces per-site configuration managed in the Nimbu backend. Use it to populate select elements, locale pickers, and country lists.

AccessorReturns
config.localesArray of publicly visible locale codes.
config.all_localesAll configured locales, including hidden ones.
config.hidden_localesLocales hidden from public navigation (useful during translations).
config.customers.<field>_items[label, id] pairs for customer select fields.
config.customers.countriesAllowed customer countries.
config.channels.<slug>.<field>_itemsSelect options for a channel field.
config.products.<slug>.<field>_itemsSelect options defined on a product attribute.
config.countriesCountries enabled for the current storefront.
config.countries_from_the_worldFull ISO country list for global forms.
config.available_shipping_methodsShipping methods available to the current site.

URL & Request Helpers

The url drop is available during real requests and encapsulates canonical URL utilities:

  • url.current – Full URL including domain.
  • url.current_path – Path without scheme and host.
  • url.language_independent_path – Path stripped from the locale prefix.
  • url.back / url.referrer – Referrer URL when provided.
  • url.query_string – Raw query string.

Combine with locale_url_prefix to build consistent navigation. The bare path helper mirrors the path stored in the Rack env (including simulator overrides) and is helpful for conditional rendering.

menus.<slug> returns a navigation tree with:

  • Menu level accessors: name, permalink, items, all_items, updated_at.
  • Menu item accessors: name, kind, description, target, leaf?, children, children?, active?, active_parent?.

Render menus with the {% nav %} tag for automatic markup, or iterate manually over menus.<slug>.items for full control.

Blogs & Articles

blogs aggregates all blogs and blog posts:

  • blogs.<slug> – Blog drop exposing id, name, articles, articles_count, tags, description, url, next_article, previous_article, updated_at, and header assets.
  • blogs.articles – Collection across all blogs.
  • Article accessors include publication metadata, associated blog, URL, author, translations, header/thumbnail/OG imagery, and convenience enumerables (first, last, latest, random, etc.).

Pages & Trees

Use the {% tree %}, {% breadcrumbs %}, and {% sitemap %} tags to generate hierarchical navigation. The page object inside layouts provides translation metadata and locale-aware URLs.

Channel Data (channels Drop)

Channels behave like custom CMS collections. channels.<slug> exposes:

  • Enumeration helpers: all, first, last, latest, count, size, empty?, any?, random (limited by loop limit).
  • Query helpers: {% scope %} tag, {% sort %} tag, where, where_exp, group_by, find, and Liquid filters such as sort and numeric_sort.
  • Metadata: slug, name, description, attributes, select_options, new_entry, updated_at.
  • Publishable channels automatically hide drafts and future scheduled entries in public rendering. Explicit scopes on _status or _publish_at override that filter.
  • ACL filtering is opt-in for channel loops. Use {% scope use_acl %} when the current customer should only see rows allowed by the channel ACL and each entry's _acl.

Individual channel entries always include id, created_at, updated_at, title, url, _permalink, _slug, _seo_title, _seo_description, alongside all custom fields defined in the backend. Publishable channel entries also expose _status (draft, published, or scheduled) and _publish_at. These managed fields are not listed as ordinary custom fields. References to other channels or products are exposed as nested drops; references to publishable channel entries are filtered in public rendering.

Commerce Drops

Products

products gives you access to the entire catalogue:

  • Collection helpers: attributes, attributes_with_counts, attributes_in_use, attributes_in_use_with_counts, attributes_in_use_with_zero_counts, current_filters, select_options, first, last, count, latest, random, etc.
  • Product fields: id, created_at, updated_at, name, description, sku, weight, url, variants, next, previous, price, on_sale, on_sale_price, effective_price, status, current_stock, amount_in_cart, tax_scheme, type, vendor, aggregated?, subproducts, advanced_pricing_enabled?, pricing_schemes, pricing_schemes_for_current_customer, price_for_current_customer, price_points_for_current_customer, seo_title, seo_description, plus custom attributes.
  • Variant fields: id, name, url, price, on_sale_price, weight, no_taxes, no_shipping, sku, stock, tax_scheme.

Collections, Types, Vendors

  • collections.<slug> – Access assigned products and metadata (name, description, slug, url, current?, product_count).
  • product_types / product_vendors – Provide taxonomy lists with enumerable helpers (first, last, all, count, random, etc.) and per-entry attributes (name, slug, url, current?).

Orders & Cart

orders exposes order collections for account pages. The cart drop (in session) includes line items, totals, shipping and payment information, and is compatible with filters like checkout_button, payment_form, and cart-edit helpers documented in Filters & Tags.

Customers

customers allows querying customer records, while the session-level customer drop exposes the authenticated user with fields such as id, email, first_name, last_name, addresses, and any custom attributes configured in the backend.

consent_manager centralizes user consent interactions. Use it with the {% consent_manager %} tag and related helpers to render banners, check acceptance of categories, or suppress tracking based on user preferences.

Working with Editable Content

Editable regions (editable_field, editable_text, editable_select, editable_file, editable_switch, editable_reference, editable_canvas, editable_group, repeatable) let content authors change copy, media, or references directly in the backend. Each tag supports optional label, hint, and assign parameters. Refer to Forms & Editable Content for syntax, grouping, and repeatable region patterns.

Copywriting & Translation Keys

Wrap literal strings in {% translate %} tags to make them translatable. Provide a default: fallback and optional variables. Example:

{% translate 'cta.checkout', default: 'Checkout %{amount}', amount: cart.total_price | money_with_currency %}

Define locale names and other shared strings via Copywriting keys (e.g. locale.en, locale.fr) to populate UI elements such as language selectors and footers.

Common Patterns

  • When filtering channels by references, use the stored _id fields (field_id, field_ids). Combine with map: '_id' to build arrays of IDs.
  • Construct dynamic scopes by capturing expressions: {% scope {{ dynamic_expression }} %}.
  • Cache localized fragments by including locale and translation outputs in cache keys.
  • Use form_model inside {% form %} blocks to inspect bound values and validation errors when re-rendering forms after submission.

This overview prepares you to use the filter and tag catalogue in the next chapter.

On this page