2016-12-07 2 views
0

私は、ショップ化ストアユーザーが設定で選択できるコレクションをループしようとしています。今私は特定のコレクションを割り当てる場合はすべてが動作しますが、私はそれを動的に変更することはできません。 スキーマを液体でループする(ショップ化する)コレクションを選択しましたか?

<div id="slideshow"> 
    <div class="wrapper"> 
    <div class="rslides_container"> 
     <ul class="rslides" id="slider1"> 
      {% assign _collection = collections['new-products'] %} 
      {% for product in _collection.products %} 
       <li class="slideshow-item"> 
        <a href="{{ product.url }}"><img src="{{ product.featured_image | img_url: 'medium' | format: 'jpg' }}" alt="{{ block.settings.slide_heading }}"></a>    
        <h3>{{ product.title }}</h3> 
        <h4>{{ product.price | money | remove: '.00' }}</h4> 
        <p>{{ product.description }}</p> 
        {% include 'buybutton' %} 
       </li> 

      {% endfor %} 
      </ul> 
     </div><!-- #slideshow-container --> 
    </div> 
</div><!-- #slideshow --> 
{% schema %} 
    { 
    "name": "Slideshow", 
    "settings": [ 
     { 
      "type": "collection", 
      "id": "feature_collection", 
      "label": "Chose Collection to show on slideshow" 
     } 
    ] 
    } 
{% endschema %} 

は私がにforループを変える考えた:

{% for product in collections[settings.feature_collection].products %} 

が仕事だろうが、それはちょうどかかわらず、私はテーマカスタマイザーで選択したものを収集スライダーに何も表示されません。誰もこれをやったか、それをする方法を知っていますか?ありがとう!

答えて

1

私はそれを考え出しました。私はループステートメントに1つの部分を残しました。

{% for product in collections[section.settings.feature_collection].products %} 

私が割り当てタグを削除してください.settings

0

私は試してみます。

{collection.feature_collection.product%以下で製品の%は}

+0

前の単語のセクションがありませんでしたか? – SleBluue

+0

そして、それは動作しませんでした..今はスライダーに何も表示されません – SleBluue

関連する問題