液体模板Shopify不渲染

时间:2017-05-17 00:15:12

标签: shopify liquid

下面是我的一段代码,我从Shopify的常规设置中获取了一些项目。大括号中的第一个变量settings.featured1会将值拉入但不包含在contains语句中。关于为什么的任何想法?

    <h1>{{ settings.featured1 }}</h1><div class="leftArrow">&#10096</div>
    <div class="shift-scroll">
    {% for collection in collections %}
    {% if collection.handle contains settings.featured1 %}


        {% tablerow product in collection.products limit:8 %}
        <div class="one-third column alpha thumbnail even">
            <a href="{{ product.url | within: collection }}" title="{{ product.featured_image.alt | escape }}">
                <img class="scroll-img" src="{{ product.images.first | product_img_url: 'medium' }}" alt="{{ product.featured_image.alt | escape }}" />

            </a>
        </div>
        {% endtablerow %}
  {% endif %}
  {% endfor %}
  </div>

1 个答案:

答案 0 :(得分:1)

雅各布的回答使我朝着正确的方向前进。我不得不放下设置var。

  {% assign search_term = settings.featured2 | downcase %}
  {% for collection in collections %}
  {% if collection.handle contains search_term %}