Global context

Store identity, routes, localization, navigation, consent, the age gate, and request state.

These pages list the exact data fields available to hosted Vascula themes. Add a root name such as product to a section's ctx_needs, then read it directly as product.title in the template. The ctx. prefix shown here identifies the public contract; do not include that prefix in a Vascula expression. Required fields are present whenever their containing object is present. Optional fields may be absent, and nullable fields may be present as null. [] marks an array item and {key} marks a key selected at runtime. Named types such as Price and Media are detailed on Shared data shapes.

ctx.shop#

Store identity, storefront-visible store metafields, and the active market's standing free-shipping offer. Available on every storefront route. Declare it in ctx_needs before reading it.

Field

Type

Requirement

ctx.shop

Object

Declared root

ctx.shop.checkout_enabled

Boolean

Optional

ctx.shop.free_shipping

Object

Optional

ctx.shop.free_shipping.rate_below

Money input

Required

ctx.shop.free_shipping.threshold

Money input

Required

ctx.shop.metafields

Metafields

Optional

ctx.shop.name

String

Required

ctx.shop.primary_domain

String

Optional

ctx.menus#

Available navigation menus keyed by handle. Resource picker settings resolve a selected menu to its full item tree. Available on every storefront route. Declare it in ctx_needs before reading it.

Field

Type

Requirement

ctx.menus

Object keyed by name

Declared root

ctx.menus.{key}

Menu summary

Dynamic key

ctx.routes#

Canonical storefront URLs using the store's locale, country, and permalink configuration. Available on every storefront route. Declare it in ctx_needs before reading it.

Field

Type

Requirement

ctx.routes

Object

Declared root

ctx.routes.account_url

URL

Required

ctx.routes.blog_url

URL

Required

ctx.routes.brands_url

URL

Required

ctx.routes.cart_url

URL

Required

ctx.routes.categories_url

URL

Required

ctx.routes.checkout_url

URL

Required

ctx.routes.collections_url

URL

Required

ctx.routes.login_url

URL

Required

ctx.routes.register_url

URL

Required

ctx.routes.root_url

URL

Required

ctx.routes.search_url

URL

Required

ctx.routes.shop_url

URL

Required

ctx.routes.vendors_url

URL

Required

ctx.routes.wishlist_url

URL

Required

ctx.localization#

Current locale and the country and language choices enabled for this storefront. Available on every storefront route. Declare it in ctx_needs before reading it.

Field

Type

Requirement

ctx.localization

Object

Declared root

ctx.localization.available_countries

Array of country

Required

ctx.localization.available_languages

Array of language

Required

ctx.localization.baseline_locale

String

Required

ctx.localization.country

Country or null

Required; may be null

ctx.localization.locale

String

Required

ctx.localization_prompt#

The platform decision for whether to offer a country or language change to this visitor. Available on every storefront route. Declare it in ctx_needs before reading it.

Field

Type

Requirement

ctx.localization_prompt

Object

Declared root

ctx.localization_prompt.can_choose_country

Boolean

Required

ctx.localization_prompt.can_choose_locale

Boolean

Required

ctx.localization_prompt.current_country_code

String

Required

ctx.localization_prompt.dismissal_days

Integer

Required

ctx.localization_prompt.dismissed

Boolean

Required

ctx.localization_prompt.enabled

Boolean

Required

ctx.localization_prompt.mode

String

Required

ctx.localization_prompt.reason

String

Required

ctx.localization_prompt.should_show

Boolean

Required

ctx.localization_prompt.suggested_country_code

String

Required

ctx.localization_prompt.visitor_country_code

String

Required

ctx.breadcrumbs#

The platform-resolved entity trail. Themes may prepend their localized Home link. Available on the routes that provide this data when declared in ctx_needs.

Field

Type

Requirement

ctx.breadcrumbs

Object

Declared root

ctx.breadcrumbs.items

Array of pagination link

Required

Visitor consent state. available_categories lists the optional cookie categories the consent banner offers, in display order; categories lists the ones the visitor has granted. Available on every storefront route. Declare it in ctx_needs before reading it.

Field

Type

Requirement

ctx.consent

Object

Declared root

ctx.consent.available_categories

Array of string (analytics, advertising, advertising_data, personalized_advertising, personalization)

Required

ctx.consent.categories

Array of string

Required

ctx.consent.given

Boolean

Required

ctx.consent.required

Boolean

Required

ctx.age_gate#

The store's age gate for this visitor: show is true when the gate applies to the visitor's country. Copy is already in the shopper's language, with the minimum age filled in. Render the gate as the global_overlay section age-gate, and render it only when ctx.age_gate.show is true: the platform adds its gate runtime only then, so a gate rendered while show is false can never be dismissed. Give its root data-tf-age-gate, role="dialog", aria-modal="true" and an aria-labelledby heading, and mark the buttons data-tf-age-gate-confirm and data-tf-age-gate-decline. The platform hides it before first paint for visitors who already confirmed, traps focus, stores the answer for remember_days days (0: the browser session) and handles declining (decline_url, or its own come-back-later screen when decline_url is empty). Keep the page content in the HTML. If the theme renders no age-gate section, the platform adds a plain one. Available on every storefront route. Declare it in ctx_needs before reading it.

Field

Type

Requirement

ctx.age_gate

Object

Declared root

ctx.age_gate.body

String

Required

ctx.age_gate.confirm_label

String

Required

ctx.age_gate.decline_label

String

Required

ctx.age_gate.decline_url

String

Required

ctx.age_gate.enabled

Boolean

Required

ctx.age_gate.heading

String

Required

ctx.age_gate.min_age

Integer

Required

ctx.age_gate.remember_days

Integer

Required

ctx.age_gate.show

Boolean

Required

ctx.csrf_token#

The signed form nonce for hosted storefront mutations. Available on every storefront route. Declare it in ctx_needs before reading it.

Field

Type

Requirement

ctx.csrf_token

String

Declared root

ctx.design_mode#

True while the theme editor renders the page for the merchant, false for shoppers. Use it to show placeholders for content the merchant has not chosen yet, and render nothing for shoppers instead. Available on every storefront route. Declare it in ctx_needs before reading it.

Field

Type

Requirement

ctx.design_mode

Boolean

Declared root

ctx.theme_preview#

True when the page renders sample content in a theme preview (the theme store demo and the theme tooling preview), false on a store. Use it for a theme's own sample artwork where a merchant setting is empty; a store shows nothing there instead. Available on every storefront route. Declare it in ctx_needs before reading it.

Field

Type

Requirement

ctx.theme_preview

Boolean

Declared root