HELP! How To Show All Products From One Collection On Front Page, Or Even Just All Products.

Highlighted
Shopify Partner
3 0 0

Right now, my store has one collection with a few products in. I am running a Theme Based on Timber.

The home page has two sections, one called "Front Page Collections" which has four sample products in it, and another called "Featured Collections" which apprently show collections. I currently have one collection called "View All" with three products in it.

What I want is a section called View All on the frontpage and to have it display everything proudct in the "View All" collection. There will be 3 or 4 at first with a maximum of about 12 eventually

How do I make it so the front page lists all the products in this one collection? I can't seem to find the liquid code to make it work in index.liquid - does anyone know how to do this?

Since it is such a small store we want to display all the products on the front page. We have no need for collections even because all products will be books and there will only be a limited amount of them.

Any help is greatly appreciated.

0 Likes
Highlighted
Astronaut
1890 1 442

In index.liquid, you might find:

  {% comment %}
    Loop through products in your Frontpage collection.
    This collection is created by default, but you must add products to it.
  {% endcomment %}
  {% for product in collections.frontpage.products limit:4 %}

Try changing the last line to:

  {% for product in collections.all.products %}

I hope this helps.

2 Likes
Highlighted
Shopify Partner
3 0 0

Thanks Alex...that got the products to show. Yea. Hard to believe I;ve spent over two hours looking for that little piece of knowledge.

Couple more questions if you don't mind...hope to I change the section title to something other than "Front Page Collections"?

And how can I target a different collection is I wanted to add another section and have it show products from just that one collection?

Regards,

John

http://developer-15.myshopify.com/

0 Likes
Highlighted
Astronaut
1890 1 442

Edit the language page.  Navigate to Homepage > Sections > Frontpage_title.  Change the title there.

To target another collection, just replace "all" with the handle of the target collection.  An easy way to find the handle of a collection is to look at the URL of the collection.  For example, if the URL is "/collections/books/", you can use either of the notations below.

collections.books.products
collections['books'].products

 

1 Like
Highlighted
Shopify Partner
3 0 0

Thanks again...wow Languages is such a really bad unintuitive name for that page. I would have never looked there in a million years.

Thanks for the insight. I now have some forward progress!

0 Likes
Highlighted
Tourist
6 0 0

Hi, 

I find your answer really helpful. However, can you please teach me how to loop through products in the CURRENT collection?

Thanks

 

0 Likes