reggi / shopify

Just a place to track issues and feature requests that I have for shopify
3 stars 1 forks source link

Variable variable names #7

Open reggi opened 9 years ago

reggi commented 9 years ago

Originally posted here https://github.com/Shopify/liquid/issues/493

Can we please get a way to create variables with variable names :)

{% assign myVar = "hello" %}
{% assign [myVar] = "hello2" %}
{{ hello }} <!-- hello2 -->

or

{% assign myVar = "hello" %}
{% assign global[myVar] = "hello2" %}
{{ hello }} <!-- hello2 -->

or create objects :) or append to existing objects :)

{% assign shop.hello = "win" %}
{{ shop.hello }}

and

{% assign shop["hello"] = "win" %}
{{ shop["hello"] }}