To access specific collection attributes, you must know collection handle and use this kind of code :

{{ collections['the-handle'].url }}

So to achieve what you want to do, here is what you could do:

{% assign collection_handle = 'the-handle-of-collection-you-want' %}
{% for product in collections[collection_handle].products %}
    Do your stuff
{% endfor %}

Note that you cannot access a collection through its title. Only handle.

Learning more about what's handle: https://help.shopify.com/themes/liquid/basics/handle

HTH

Answer from Alice Girard on Stack Overflow
🌐
Shopify
shopify.dev › docs › api › liquid › objects › collection
Liquid objects: collection
The handle of the collection. ... The ID of the collection. ... The image for the collection. This image is added on the collection's page in the Shopify admin.
🌐
HulkApps
hulkapps.com › home › shopify hub › a complete guide on how to get collection handle in shopify
A Complete Guide on How to Get Collection Handle in Shopify
April 11, 2024 - A collection handle in Shopify is a unique, URL-friendly identifier assigned to each collection within your store. It facilitates accessing and manipulating specific collections through Liquid, Shopify's templating language.
🌐
Entaice
entaice.com › blog › shopify-liquid-get-collection-by-handle
How to Fetch Collections in Shopify Using Liquid's Handle | Entaice
September 7, 2023 - So, for instance, if you have a collection named “Summer Vibes”, its handle will most likely be ‘summer-vibes’. Cool, right? Shopify uses this approach to make it easy for us (and the URLs) to keep track of different collections without breaking a sweat.
🌐
Shopify
shopify.dev › docs › api › admin-graphql › latest › queries › collectionByHandle
collectionByHandle - GraphQL Admin
query { collectionByHandle(handle: "there is no collection with a handle like this") { id title products(first: 5, reverse: true) { edges { node { id title createdAt priceRangeV2 { minVariantPrice { amount currencyCode } maxVariantPrice { amount currencyCode } } } } } } } curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-07/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query { collectionByHandle(handle: \"there is no collection with a handle like this\") { id title products(first: 5, reverse: true) { edges { node { id title createdAt priceRangeV2 { minVariantPrice { amount currencyCode } maxVariantPrice { amount currencyCode } } } } } } }" }'
🌐
Findify
developers.findify.io › v3 › docs › shopify-add-collection-handle-to-the-product-url
Shopify: add collection handle to the product url
/* some imports here */ import { withProps, compose, withHandlers } from 'recompose'; /* some code here */ /* we need this function to navigate to a different url */ const navigate = (openInNewWindow, url) => { if (!window) return; if (openInNewWindow) return window.open(url, '_blank'); return window.location.href = url; } /* this function updates the url by adding collection handle */ const appendCollectionSlot = (url) =>{ const collectionSlot = findify.utils.collectionPath(); return url.split('/products/').join(`/${collectionSlot}/products/`); } /* this enhancer has a check for whether it's
🌐
Shopify Community
community.shopify.com › technical q&a
How to Change the URL Handle of the "All" Collection through Code ...
September 9, 2023 - Hello everyone, I would like to change the URL handle of the “All” collection on my Shopify store from mysite.com/collections/all to something more descriptive, like mysite.com/collections/everything. I want to do this …
Find elsewhere
🌐
Shopify Community
community.shopify.com › technical q&a
Adding content to collection page based on collection handle - ...
June 30, 2021 - Hi, I’m wanting to add an editable content section under products on the collection page. Content is specific to each collection. Help please 🙂
🌐
Shopify
shopify.dev › docs › api › admin-rest › latest › resources › collection
Collection
-H "X-Shopify-Access-Token: {access_token}" {} JSON · 99 · 1 · 2 · 3 · 4 · 5 · 6 · 7 · 8 · 9 · 10 · 11 · 12 · 13 · 14 · 15 · 16 · 17 · 18 · 19 · 20 · 21 · 22 · 23 · 24 · HTTP/1.1 200 OK · { "collection": { "id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "<p>The best selling ipod ever</p>", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 1, "collection_type": "custom", "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/
🌐
How Commerce
howcommerce.com › shopify-handle
What is a Shopify handle and how to work with it? – How Commerce
A Shopify handle is a unique identifier used by Shopify to create SEO-friendly URLs for various resources within a Shopify store, such as products, collections, pages, navigation menus, blog posts / articles and many more.
🌐
Markdunkley
cheat.markdunkley.com
Shopify Cheat Sheet - Liquid variables
The handle of a collection with the title "Winter Sale" would be "winter-sale".
🌐
Shopify Community
community.shopify.com › shopify discussion
Can I alter the handle of collections on my ecommerce site? - Shopify ...
Is it possible to change someurl.com/collections/product to something like someurl.com/photo-collections/product ?
Published   May 9, 2023
🌐
Shopify Community
community.shopify.com › shopify discussion
Loop through a collection using a collection ID
May 15, 2023 - Hi there, Trying to figure out how to loop through a collection using the collection ID. Is this possible? Right now I’m using the collection name, ie: collections['collection-name'].products but needing to transition a…
🌐
Shopify Help Center
help.shopify.com › en › manual › products › collections › make-collections-available
Shopify Help Center | Managing collections on your sales channels
You can edit the handle to make it match your collection title, but don't edit it too often or the collection might not display in search engine results. From your Shopify admin, go to Products > Collections.
🌐
Avada
avada.io › home › shopify › shopify devdocs › how to create a collection-aware product url in shopify
How to Create a Collection-aware product URL in Shopify
February 25, 2025 - A collection-aware product URL is created by prepending /collections/collection-handle to a product URL.
🌐
Shopify Community
community.shopify.com › technical q&a
Capturing Article.Handle and using it to find a Collection with that handle - Shopify Community
December 6, 2022 - Hi all. I’m a bit stuck on this one. I’ve done something before but cannot for the life of me remember how to do it. Any help is greatly apprecited. I’m trying to show a Collection on a Blog Article Page. The Collection I need to show has the same handle as the blog article.
🌐
Shopify Community
community.shopify.com › technical q&a
If product is in a specific collection, show specific code on page
April 14, 2022 - So I am working on a product specifications table for our website and I would like for the code to show certain aspects of that table based off an if else or case statement. For example, we have various appliances and i…