Shopify / dawn

Shopify's first source available reference theme, with Online Store 2.0 features and performance built-in.
Other
2.53k stars 3.41k forks source link

Add collection per page setting for Collection list template #1767

Open melissaperreault opened 2 years ago

melissaperreault commented 2 years ago

Observation

We currently offer the limit of 28 or 30 collections per page depending on how many items you display per column.

The numbers are arbitrary given the flexibility we offer for the Collection template where we offer the number of items per page along with the number of columns.

Originally posted by @melissaperreault in https://github.com/Shopify/dawn/pull/1745#pullrequestreview-996858087

ferwegner commented 2 years ago

I made a page template, and in this page I created a personalized liquid section with the code below, that lists all the collections linked in the menu with the same name as the page. The problem is, I am trying to paginate those collections listed, but nothing works. I tried: {% paginate collection-list grid by 24 %} {% paginate collections by 24 %} {% paginate collections['my-handle'].products by 24 %} {% paginate collections.products by 24 %}

Does anyone know how to paginate the list of collections?

The code that I used in the personalized liquid section is: `{{ 'component-card.css' | asset_url | stylesheet_tag }} {{ 'section-collection-list.css' | asset_url | stylesheet_tag }}

    {% for link in linklists[page.handle].links %} {% if link.type == 'collection_link' %} {% assign collection = link.object %}
  • {% render 'card-collection', card_collection: collection, media_aspect_ratio: section.settings.image_ratio, columns: 3 %}
  • {% endif %} {%- endfor -%}
`
ferwegner commented 2 years ago
personalized liquid