Shopify收藏问题,限制和扩展内容

Shopify收藏问题,限制和扩展内容,shopify,liquid,Shopify,Liquid,我在Shopify中有一个收藏,我只想展示其中的4种产品。然后,如果用户单击按钮展开并查看集合的更多内容,则将显示集合的其余部分。目前,我只是将收藏限制在4个,我试图找到一种方法,使链接填充到收藏的其余部分。不确定使用两个不同的集合是否比以这种方式限制更好。这是我当前的代码: <ul id="collection-grid" class="product-grid"> {% assign collectionName = 'featured-products' %}

我在Shopify中有一个收藏,我只想展示其中的4种产品。然后,如果用户单击按钮展开并查看集合的更多内容,则将显示集合的其余部分。目前,我只是将收藏限制在4个,我试图找到一种方法,使链接填充到收藏的其余部分。不确定使用两个不同的集合是否比以这种方式限制更好。这是我当前的代码:

<ul id="collection-grid" class="product-grid">


 {% assign collectionName = 'featured-products' %}

    {% for product in collections.featured-products.products limit:4 %}

    <div class="grid_left">
    {% include 'product-grid-item' %}
    </div><!-- end of grid_left -->
 {% endfor %}
</ul>



    <div class="expand_selection">

      <a href=""><img src="http://cdn.shopify.com/s/files/1/0173/1766/files/expand.gif" alt="Expand" /></a> Click to expand for more supplements...

    </div><!-- end of expand_selection -->
    {%assign collectionName='特色产品'%} {集合中产品的百分比。特色产品。产品限制:4%} {%include'产品网格项“%” {%endfor%}
单击展开以获取更多补充。。。
您可以使用隐藏的
和一些javascript(为了简单起见,我使用了jQuery),例如:

{% for product in collections.featured-products.products limit:4 %}
  <!-- first 4 products -->
{% endfor %}

<a href="#" onclick="jQuery("#rest_of_collection").show()">show all products</a>

<div id="rest_of_collection" style="display:none">
  {% for product in collections.featured-products.products offset:5 %}
    <!-- other products -->
  {% endfor %}
</div>
{%用于collections.featured-products.products限制中的产品:4%}
{%endfor%}
{collections.featured-products.products偏移量中产品的百分比:5%}
{%endfor%}