Skip to content

assign

Creates a variable.

The value can be any expression, including filters. Variables live until the end of the file (snippets rendered with render get their own scope).

{% assign name = value %}
Name Type Description
name (required) string Variable name.
value (required) any Value or expression.
Liquid
{% assign greeting = 'Marhaba' | append: ', Noora' %}{{ greeting }}
Output
Marhaba, Noora

Shopify: Same as Shopify.

Since theme platform 1.0.

Was this page helpful?