Skip to main content
Fluid supplies global variables and template-scoped variables when it renders Liquid. Global variables describe the storefront, request, localization, attribution, and shared resources. Template variables describe the resource or experience being rendered. Use this reference to choose the correct scope before you build a section.

Understand variable scope

Global variables are available to rendered storefront templates. Template variables are available only in their matching context. For example, product is available in a product template, while post is available in a post template. An unavailable value renders blank. Guard optional values and arrays before you use them:
Use default for presentation fallbacks:
Do not use a fallback to hide a misspelled field. Confirm the variable’s context and name first.

Global variables

The following top-level values are shared across rendered storefront templates. Some values can still be blank when the current visitor or company does not provide the underlying data. navbar, footer, and sections are also assembled for the current template. Use their settings within the corresponding theme structure.
On-demand resource collections are not populated for static content renders. Test a resource loop in a rendered storefront context.

Company points labels

Use company.points_label.singular and company.points_label.plural instead of hard-coding a rewards label. Product and variant values also expose the same pair where points data appears.
Select the singular or plural form yourself. The value does not choose a form based on the number.

Affiliate hydration

Cached storefront HTML can contain sentinel values that the FairShare client replaces after it resolves attribution. Do not treat affiliate.name as a reliable server-rendered sign-in check. Use affiliate.logged_in_rep_for_store for the sign-in state. See affiliate hydration before you branch on affiliate fields or build attributable URLs.

Localization

localization.country is the selected country object. localization.language is the selected language object. The available collections include display names, ISO codes, and selection state. Country entries also include currency details.

Product template

Use product for the current product. Images expose fields such as id, src, url, position, and media_type. Variants include identity, availability, selected option values, localized pricing, images, and points labels. Bundle groups include their selection constraints, pricing configuration, images, and items.

Shop template

Use these values in shop_page templates: Each collection.filters entry includes its label, selection values, input name, presentation, and add or remove URLs. Use the supplied URLs instead of reconstructing filter query strings.

Collection template

Use collection for the current collection.

Home template

Use these values in home_page templates: Prefer the global products collection for new product loops.

Join template

Use these values in join_page templates: Each entry in collection.enrollment_packs uses the enrollment-pack shape described below.

Medium template

Medium templates expose the medium fields at the top level. Check kind before selecting a media-specific URL:

Enrollment-pack template

Use enrollment_pack for the current enrollment pack. Membership and subscription product entries include display values, product options, and bundle information where applicable. Agreement entries include id, title, description, and required.

Library template

Library templates expose: Every library item includes id, type, title, description, image, and url. Product items add product, pricing fields, and enrollment items add enrollment_pack. Medium items add kind and the matching media URLs.

My Site template

Use fluid_affiliate in mysite templates. Each display card identifies the saved item and contains a favoriteable object. The nested object provides common card content plus resource-specific URLs, pricing, or media fields.

Cart template

Use cart in cart_page templates. Cart items contain the line’s resource, quantity, pricing, and option data supplied to the storefront cart. Guard optional product or enrollment-pack details because the item shape depends on its resource.

Post template

Use post for the current post. Category and collection summaries include id, title, description, and image_url.

Use variables from schema settings

Resource settings resolve saved identifiers into Liquid values. For example, a product setting makes the selected product available at section.settings.featured_product.
Use the setting ID as the key under section.settings or block.settings. See schema components for supported resource setting types.