shopify将变量传递给设置

时间:2014-09-22 18:05:20

标签: shopify liquid

我想在Shopify中做这样的事情:

{% for i in (0..10) %}
  {% capture slide %}slide{{i}}{% endcapture %}
  {{ settings.slide }}//i need the value of this one
  // i want to get the values for settings.slide1, settings.slide2 etc
{% endfor %}

另一个例子:

{% for i in (0..10) %}
  {{ settings.slide[i] }}//i need the value of this one
{% endfor %}

这是我想要实现的简化版本。 感谢

1 个答案:

答案 0 :(得分:1)

试试这个:

{% for i in (0..10) %}
  {% assign current_slide = 'slide' | append: i %}
  {{ settings[current_slide] }}
{% endfor %}
相关问题