Ad

Liquid Template Shopify Not Rendering

- 1 answer

Below is my piece of code and I am grabbing some items from the general settings in Shopify. The first variable settings.featured1 in curly bracket pulls the value in but inside the contains statement it doesn't. Any ideas on why?

    <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 target="_blank" rel="nofollow noreferrer" target="_blank" rel="nofollow noreferrer" 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>
Ad

Answer

Jacob's answer led me in the right direction. I had to downcase the setting var.

  {% assign search_term = settings.featured2 | downcase %}
  {% for collection in collections %}
  {% if collection.handle contains search_term %}
Ad
source: stackoverflow.com
Ad