You can feature a subset of collections on a custom page by editing your theme code. This tutorial shows you how to create a
new page template and assign collections to show by using a menu.
All Shopify stores have a collections list page at the URL www.mystore.com/collections that shows all of the collections in the store. As an alternative to this tutorial, you can edit your collections list page to show only a selection of your collections.
From your Shopify admin, go to Online Store > Themes.
Find the theme you want to edit, and then click the ... button > Edit code.
In the Templates directory, click Add a new template.
Create a new template for page called list-collections.
Delete the existing code in your new page.list-collections file. Find your theme code below and copy and paste the code in your page.list-collections file.
Click Save.
Select your theme
The code for this customization varies depending on your theme. Click the button for your theme before copying and pasting it into your page.list-collections file:
Boundless
Code for Boundless
Copy the code.
{% comment %}
Featuring collections on a page using a menu
https://shopify-dev.com/tutorials/feature-a-subset-of-collections-on-a-page
{% endcomment %}
<div class="grid grid--no-gutters collection-grid">
{%- for link in linklists[page.handle].links -%}
{%- if link.type == 'collection_link' -%}
{%- assign featured = link.object.handle -%}
{%- include 'collection-grid-item', collection: collections[featured] -%}
{%- endif -%}
{%- endfor -%}
</div>
</div>
Paste the code into the page.list-collections file.
Brooklyn
Code for Brooklyn
Copy the code.
{% comment %}
Featuring collections on a page using a menu
https://shopify-dev.com/tutorials/feature-a-subset-of-collections-on-a-page
{% endcomment %}
{%- assign collection_count = 0 -%}
{%- assign isEmpty = true -%}
{%- for link in linklists[page.handle].links -%}
{%- if link.type == 'collection_link' -%}
{%- assign collection_count = collection_count | plus: 1 -%}
{%- endif -%}
{%- endfor -%}
<div class="grid collection-grid">
{%- for link in linklists[page.handle].links -%}
{%- if link.type == 'collection_link' -%}
{%- assign collection = collections[link.object.handle] -%}
{%- assign collection_index = collection_index | plus: 1 -%}
{%- assign collection_handle = collection.handle -%}
{% include 'collection-grid-collage' %}
{%- endif -%}
{%- endfor -%}
</div>
Paste the code into the page.list-collections file.
Debut
Code for Debut
Copy the code.
{% comment %}
Featuring collections on a page using a menu
https://shopify-dev.com/tutorials/feature-a-subset-of-collections-on-a-page
{% endcomment %}
{%- for link in linklists[page.handle].links -%}
{%- if link.type == 'collection_link' -%}
{%- assign collection = collections[link.object.handle] -%}
<li class="grid__item {{ grid_item_width }}">
{% include 'collection-grid-item', collection_image_size: image_size %}
</li>
{%- endif -%}
{%- endfor -%}
</ul>
</div>
Paste the code into the page.list-collections file.
Minimal
Code for Minimal
Copy the code.
{% comment %}
Featuring collections on a page using a menu
https://shopify-dev.com/tutorials/feature-a-subset-of-collections-on-a-page
{% endcomment %}
{%- for link in linklists[page.handle].links -%}
{%- if link.type == 'collection_link' -%}
{%- assign featured = link.object.handle -%}
<div class="grid__item {{collection_item_width}} text-center">
{% include 'collection-grid-item' with collection_width: collection_width %}
</div>
{%- endif -%}
{%- endfor -%}
</div>
Paste the code into the page.list-collections file.
Narrative
Code for Narrative
Copy the code.
{% comment %}
Featuring collections on a page using a menu
https://shopify-dev.com/tutorials/feature-a-subset-of-collections-on-a-page
{% endcomment %}
{%- for link in linklists[page.handle].links -%}
{%- if link.type == 'collection_link' -%}
{%- assign collection = collections[link.object.handle] -%}
{% include 'collection-card', collection: collection, width: desktopColumns, grid_style: grid_style %}
{%- endif -%}
{%- endfor -%}
</div>
</div>
</div>
</div>
Paste the code into the page.list-collections file.
Simple
Code for Simple
Copy the code.
{% comment %}
Featuring collections on a page using a menu
https://shopify-dev.com/tutorials/feature-a-subset-of-collections-on-a-page
{% endcomment %}
<div class="grid grid--uniform">
{%- for link in linklists[page.handle].links -%}
{%- if link.type == 'collection_link' -%}
{% assign collection = collections[link.object.handle] %}
<div class="grid__item {{ grid_item_width }}">
{% include 'collection-grid-item' %}
</div>
{%- endif -%}
{%- endfor -%}
</div>
Paste the code into the page.list-collections file.
Venture
Code for Venture
Copy the code.
{% comment %}
Featuring collections on a page using a menu
https://shopify-dev.com/tutorials/feature-a-subset-of-collections-on-a-page
{% endcomment %}
<div class="grid grid--no-gutters grid--uniform collection" data-number-rows="{{ number_rows }}">
{% assign row_number = 1 %}
{%- for link in linklists[page.handle].links -%}
{%- if link.type == 'collection_link' -%}
{%- assign featured_collection = collections[link.object.handle] -%}
{% if collection_count > 4 and forloop.index > 3 %}
{% assign row_number = forloop.index | divided_by: 3.0 | ceil %}
{% endif %}
{% include 'collection-grid-item' with stretch_collection_image: false, height: height %}
{%- endif -%}
{%- endfor -%}
</div>
</div>
Paste the code into the page.list-collections file.
Create a page on which to feature your collections
From your Shopify admin, go to Online Store > Pages.
Click Add page.
In the page editor, enter a Title in the text box provided. You must use the same title for the menu that you'll create in the upcoming steps.
Assign your new template to the page by selecting list-collections from the Theme template drop-down menu in the Online store section.
Click Save.
Create the menu that controls which collections are shown
From your Shopify admin, go to Content > Menus.
Click the Add menu button.
Give your menu the same Title as the title that you gave the page that will feature your collections. For example, if the page you created has the title Living Room, then give your menu the title Living Room.
Add links to your menu for each collection that you want to feature by clicking Add menu item. Choose collections from your store by clicking Collections in the drop-down menu for the Link text box. Link to your collections in this way, instead of adding a URL to the text box.
Click Save menu.
Can’t find the answers you’re looking for? We’re here to help.