title: How can I output the Collection's products from a section using schema collection in Shopify?
body: <p>I am trying to display the selected collection from the schema(that user can select from the Shopify admin panel) and loop it in a slider to display.
  Please let me know how to display it on the frontend as same as I displayed content.</p>
  <p><strong>Here is my Schema Code:</strong>
  {% comment %}
  ** Single featured collection - homepage partial **
  - Draggable section
  {% endcomment %}</p>
  <pre><code>{% include 'include-collection-slider' %}
  
  {% schema %}
      {
          &quot;name&quot; : &quot;collection_tab&quot;,
          &quot;class&quot;: &quot;featured-collection-section&quot;,
          &quot;settings&quot; :[
                          {
                            &quot;type&quot;: &quot;text&quot;,
                            &quot;id&quot;: &quot;title&quot;,
                            &quot;label&quot;: &quot;Header Name&quot;,
                            &quot;default&quot;: &quot;SHOP BY NEED&quot;
                          },
                          {
                            &quot;type&quot;: &quot;collection&quot;,
                            &quot;id&quot;: &quot;collection1&quot;,
                            &quot;label&quot;: &quot;Collection 1&quot;
                          },
                          {
                            &quot;type&quot;: &quot;collection&quot;,
                            &quot;id&quot;: &quot;collection2&quot;,
                            &quot;label&quot;: &quot;Collection 2&quot;
                          },
                        
                          {
                            &quot;type&quot;: &quot;radio&quot;,
                            &quot;id&quot;: &quot;collection_style&quot;,
                            &quot;label&quot;: &quot;Collection layout&quot;,
                            &quot;default&quot;: &quot;grid&quot;,
                            &quot;options&quot;: [
                              {
                                &quot;value&quot;: &quot;slider&quot;,
                                &quot;label&quot;: &quot;Slider&quot;
                              },
                              {
                                &quot;value&quot;: &quot;grid&quot;,
                                &quot;label&quot;: &quot;Grid&quot;
                              }
                            ]
                          },
                          {
                            &quot;type&quot;: &quot;header&quot;,
                            &quot;content&quot;: &quot;Products&quot;
                          },
                          {
                            &quot;type&quot;: &quot;range&quot;,
                            &quot;id&quot;: &quot;products_per&quot;,
                            &quot;label&quot;: &quot;Products per row&quot;,
                            &quot;min&quot;: 2,
                            &quot;max&quot;: 7,
                            &quot;step&quot;: 1,
                            &quot;default&quot;: 3
                          },
                          {
                            &quot;type&quot;: &quot;range&quot;,
                            &quot;id&quot;: &quot;products_limit&quot;,
                            &quot;label&quot;: &quot;Limit products&quot;,
                            &quot;min&quot;: 2,
                            &quot;max&quot;: 50,
                            &quot;step&quot;: 1,
                            &quot;default&quot;: 9
                          }
                      ],
          &quot;blocks&quot; : [
                  {
                      &quot;type&quot;: &quot;text&quot;,
                      &quot;name&quot;: &quot;Category Tab Name&quot;,
                      
          &quot;settings&quot; :[
                              {
                                  &quot;type&quot;: &quot;text&quot;,
                                  &quot;id&quot;: &quot;tab&quot;,
                                  &quot;label&quot;: &quot;Tab Name&quot;                                     
                              },
                              {
                              &quot;type&quot;: &quot;text&quot;,
                              &quot;id&quot;: &quot;heading&quot;,
                              &quot;label&quot;: &quot;Heading&quot;
                              },
                              {
                              &quot;type&quot;: &quot;checkbox&quot;,
                              &quot;id&quot;: &quot;collection_description&quot;,
                              &quot;label&quot;: &quot;Show Description&quot;
                              },
                              {
                              &quot;type&quot;: &quot;richtext&quot;,
                              &quot;id&quot;: &quot;collection_content&quot;,
                              &quot;label&quot;: &quot;Show Content&quot;
                              },
                              
                              {
                              &quot;type&quot;: &quot;collection&quot;,
                              &quot;id&quot;: &quot;collection&quot;,
                              &quot;label&quot;: &quot;Collection&quot;
                              },
                          
                              {
                              &quot;type&quot;: &quot;radio&quot;,
                              &quot;id&quot;: &quot;collection_style&quot;,
                              &quot;label&quot;: &quot;Collection layout&quot;,
                              &quot;default&quot;: &quot;grid&quot;,
                              &quot;options&quot;: [
                                {
                                  &quot;value&quot;: &quot;slider&quot;,
                                  &quot;label&quot;: &quot;Slider&quot;
                                },
                                {
                                  &quot;value&quot;: &quot;grid&quot;,
                                  &quot;label&quot;: &quot;Grid&quot;
                                }
                              ]
                            },
                          {
                            &quot;type&quot;: &quot;header&quot;,
                            &quot;content&quot;: &quot;Products&quot;
                          },
                          {
                          &quot;type&quot;: &quot;range&quot;,
                          &quot;id&quot;: &quot;products_per&quot;,
                          &quot;label&quot;: &quot;Products per row&quot;,
                          &quot;min&quot;: 2,
                          &quot;max&quot;: 7,
                          &quot;step&quot;: 1,
                          &quot;default&quot;: 3
                        },
                          {
                        &quot;type&quot;: &quot;range&quot;,
                        &quot;id&quot;: &quot;products_limit&quot;,
                        &quot;label&quot;: &quot;Limit products&quot;,
                        &quot;min&quot;: 2,
                        &quot;max&quot;: 50,
                        &quot;step&quot;: 1,
                        &quot;default&quot;: 9
                      }
                    ]
                  
                  }
              ],
        &quot;presets&quot;: [{
      &quot;name&quot;: &quot;Collection Slider&quot;,
      &quot;category&quot;: &quot;Collection&quot;,
      &quot;settings&quot;: {
  
      }
    }]
      }
  {% endschema %}
  
  ****Here is my Liquid Code:****
  {% if type == 'block' %}
    {% assign title = block.settings.title %}
    {% assign settingHeading = block.settings.heading %}
    {% assign settingCollection = block.settings.collection %}
    {% assign collection_style = block.settings.collection_style %}
    {% assign collection_description = block.settings.collection_description %}
    {% assign products_per = block.settings.products_per %}
    {% assign products_limit = block.settings.products_limit %}
  {% else %}
    {% assign title = section.settings.title %}
    {% assign settingCollection = section.settings.collection %}
    {% assign collection_style = section.settings.collection_style %}
    {% assign collection_description = section.settings.collection_description %}
    {% assign products_per = section.settings.products_per %}
    {% assign products_limit = section.settings.products_limit %}
  {% endif %}
  
   {% assign limit = products_limit %}
    {% if collection_style == 'slider' %}
      {% assign col = settingCollection | handleize %}
      {% assign products = collections[col].products %}
      {% assign product_count = collections[col].all_products_count %}
      {% assign per_slide = products_per %}
    {% endif %}
  
  
    {% if settingCollection == blank   %}
      {%- assign section_onboarding = true -%}
      {% comment %}assign product length to be selected limit for onboarding{% endcomment %}
      {% assign products_length = products_limit | plus: 0 %}
    {% else %}
      {%- assign section_onboarding = false -%}
    {% endif %}
  
  &lt;div class=&quot;container featured_products product-{{ collection_style }}&quot;&gt;
    &lt;div class=&quot;sixteen columns center homepage_content&quot;&gt;
          &lt;h2 class=&quot;title&quot;&gt;{{ title }}&lt;/h2&gt;
    &lt;/div&gt;
       &lt;div class=&quot;tabs&quot;&gt;
          &lt;!--Collection Tabs Code Start --&gt;
        &lt;ul class=&quot;tabs-thumbs&quot;&gt;
          {%for block in section.blocks %}
            &lt;li class=&quot;tabs-thumb&quot;&gt;
              &lt;a&gt;{{block.settings.tab}}&lt;/a&gt; 
          &lt;/li&gt;
           {%endfor%}
        &lt;/ul&gt;
        &lt;!--Collection Tabs Code End --&gt;
         
        &lt;ul class=&quot;tabs-panels&quot;&gt;
          {% for block in section.blocks%}
   
          
          
          &lt;li class=&quot;tabs-panel&quot;&gt;
              &lt;div class=&quot;sixteen row collection-slider&quot;&gt;
                  &lt;div class=&quot;six columns center homepage_content&quot;&gt;
                      &lt;div class=&quot;section clearfix featured-collection__description&quot;&gt;
                      &lt;div style=&quot;display:inline-flex;margin-bottom: 15px; font-weight: 900; color: red;&quot;&gt;
                        Collection Name:{{block.settings.collection | products}}&lt;br&gt;
                        {{popular_product}}
                      &lt;/div&gt;
                          {{block.settings.collection_content}}
                      &lt;/div&gt;
                    
                  &lt;/div&gt;
                
                
                 &lt;div class=&quot;ten columns js-product-slider homepage-product-slider full-width--true  featured-collection__products&quot;&gt;
                  &lt;div class=&quot;container js-product-slider homepage-product-slider full-width--true 
                              {% if per_slide == 2 or per_slide == 4 or per_slide == 6 %}
                              even-num-slides{% endif %} featured-collection__products&quot;&gt;
                    {% if section_onboarding == false %}
                      {% if product_count &gt; 0 %}
                        {% render 'product-slider',
                                limit: limit,
                                products: products,
                                per_slide: products_per,
                                  featured_collection: col
                        %}
                    
                      {% endif %}
                     {% endif %}
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;/div&gt; 
          &lt;/li&gt;
          {%endfor%}
      &lt;/ul&gt;
      &lt;/div&gt;
    &lt;div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>