Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assigning a variable within a statement in liquid

Tags:

shopify

liquid

Is there a way to have a variable within a statement in liquid so that something like the following:

{% assign somevar = 'about-us' %}
{{ pages.somevar.content }}

would result in the same output as if you had originally used:

{{ pages.about-us.content }}
like image 658
Andy Higgins Avatar asked Mar 26 '13 15:03

Andy Higgins


1 Answers

{% assign somevar = 'about-us' %}
{{ pages.[somevar].content }}

That works fine for me...

like image 178
David Lazar Avatar answered Nov 15 '22 05:11

David Lazar