shopify将变量传递给设置
我想在Shopify中做类似的事情:shopify将变量传递给设置,shopify,liquid,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.
{% 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 %}
这是我试图实现的一个简化版本。
谢谢试试这个:
{% for i in (0..10) %}
{% assign current_slide = 'slide' | append: i %}
{{ settings[current_slide] }}
{% endfor %}