Multiple collections in one page

Shopify Partner
7 0 0

Hi. I have been seating around and can't seem to find an answer for this.

I have 3 collections with a few products in each. 

When i look at the collections separately they have a h1 and a collection description.

I would like all my collections to appear on one page as this:

First Collection h1

First Collection p

First Collection products

 

Second Collection h1

Second Collection p

Second Collection products

 

Third Collection h1

Third Collection p

Third Collection products 

 

 

 

Can that be done in some clever way?

Here are links for the collections:

http://starbra.dk/collections/first-collection

http://starbra.dk/collections/luxury-collection

http://starbra.dk/collections/raw-collection

 

Best regards

A

0 Likes
Shopify Staff (Retired)
Shopify Staff (Retired)
5711 0 125

Just use the collection handle to pull each one in separately. You can see where I've done that here: http://www.withlovefrombrooklyn.com/collections/popup

With simple individual collection calls:

 

{% for product in collections.collection-handle.products %}
collection code
{% endfor %}

 

 

 

http://shopifyplus.com ::: http://twitter.com/bacchus
0 Likes
Shopify Partner
7 0 0

Hi Thank you for your reply.

But this doesn't make sense to me.

 

Could you perhaps paste the relevant part of your template code for reference??

Thanks in advance

0 Likes
Shopify Staff (Retired)
Shopify Staff (Retired)
5711 0 125

That is the bit of relevant code above. Alexander. Make a copy or alternate version of your collection.liquid and use your current collection loop, but use one loop per collection that you want to display. Adjust your collection call from something like this:

 

          {% for product in collection.products %}
            [collection display code]
          {% endfor %}

To something more specific as show above:

 

      {% for product in collections.collection-handle.products %}
        collection code
      {% endfor %}

where collection-handle is the handle of one of your collections.

 

 

http://shopifyplus.com ::: http://twitter.com/bacchus
0 Likes
Shopify Partner
7 0 0

Hi..

Thank you for your help.

I really don't get this.

Is it something like this:

<h1>
{% for product in collection.luxury-collection.title %}
{{ collection.title }}
{% endfor %}
</h1>
{% for product in collection.luxury-collection.description %}
{{ collection.description }}
{% endfor %}

<table class="products">
{% for product in collection.luxury-collection.products %}
  {% tablerow product in collection.products cols: 4  %}
    <div>
      <a href="{{ product.url | within: collection }}"><img src="{{ product.images.first | product_img_url: 'medium' }}" alt="{{ product.title | escape }}" /><big>{{ product.title }}</big><strong>{{ product.price  | money }}</strong></a>
    </div>
  {% endtablerow %}
  {% endfor %}
</table>

And then repeat code for each collection handle

Or is it like this:

 

{% for product in collection.luxury-collection.products %}
<h1>
{{ collection.title }}
</h1>
{{ collection.description }}

<table class="products">
  {% tablerow product in collection.products cols: 4  %}
    <div>
      <a href="{{ product.url | within: collection }}"><img src="{{ product.images.first | product_img_url: 'medium' }}" alt="{{ product.title | escape }}" /><big>{{ product.title }}</big><strong>{{ product.price  | money }}</strong></a>
    </div>
  {% endtablerow %}
</table>
{% endfor %}

And then repeat code for each collection handle

None of them works.

 

 

is it because the collection nav links to a smart collection? with Variant price is greater than 0 

..?

 

Sorry for the inconvenience.

Hope you can help.

0 Likes
Shopify Staff (Retired)
Shopify Staff (Retired)
5711 0 125

Sorry my, bad I've updated my pre-coffee post, collection should be collections.

 

for product in collections.luxury-collection.products

 

 

http://shopifyplus.com ::: http://twitter.com/bacchus
0 Likes
Shopify Partner
7 0 0

ok, and is it the sec on option that is correct?

0 Likes
Shopify Staff (Retired)
Shopify Staff (Retired)
5711 0 125

Both are correct.

http://shopifyplus.com ::: http://twitter.com/bacchus
0 Likes
Shopify Partner
7 0 0

Hi I might be an idiot, but it doesn't work..

Here is a test collection

http://starbra.dk/collections/all-1&nbsp;

 

here is my collection code

{% for product in collections.luxury-collection.products %}
<h1>
{{ collection.title }}
</h1>
{{ collection.description }}

<table class="products">
  {% tablerow product in collection.products cols: 4  %}
    <div>
      <a href="{{ product.url | within: collection }}"><img src="{{ product.images.first | product_img_url: 'medium' }}" alt="{{ product.title | escape }}" /><big>{{ product.title }}</big><strong>{{ product.price  | money }}</strong></a>
    </div>
  {% endtablerow %}
</table>
{% endfor %}

{% for product in collections.raw-collection.products %}
<h1>
{{ collection.title }}
</h1>
{{ collection.description }}

<table class="products">
  {% tablerow product in collection.products cols: 4  %}
    <div>
      <a href="{{ product.url | within: collection }}"><img src="{{ product.images.first | product_img_url: 'medium' }}" alt="{{ product.title | escape }}" /><big>{{ product.title }}</big><strong>{{ product.price  | money }}</strong></a>
    </div>
  {% endtablerow %}
</table>
{% endfor %}
{% for product in collections.first-collection.products %}
<h1>
{{ collection.title }}
</h1>
{{ collection.description }}

<table class="products">
  {% tablerow product in collection.products cols: 4  %}
    <div>
      <a href="{{ product.url | within: collection }}"><img src="{{ product.images.first | product_img_url: 'medium' }}" alt="{{ product.title | escape }}" /><big>{{ product.title }}</big><strong>{{ product.price  | money }}</strong></a>
    </div>
  {% endtablerow %}
</table>
{% endfor %}

It just shows the same collection 3 times for every {% for %} tag.

 

Any ideas?

 

0 Likes
Tourist
48 0 1

Alexander,

Is that the entire code from your collection.liquid file?

-Andrew

Shopaholla E-commerce
0 Likes