> For the complete documentation index, see [llms.txt](https://cryptococo.gitbook.io/cocoshop-theme-development/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cryptococo.gitbook.io/cocoshop-theme-development/architecture/templates/collection.md).

# collection

The collection template is responsible for displaying a collection of products within your online store. It provides an organized and user-friendly way for your customers to browse through your products.

## Implementing the Collection Template

In the collection template, you can customize the layout and styling to suit your store's needs. To access and modify the collection template, locate the `collection.liquid` file within the `templates` folder of your theme. You can add, edit, or remove elements as needed to create the desired layout and functionality for your store's collections.

When displaying a collection, you can use the `collection` object to access various properties, such as the collection's title, description, or image. Additionally, you can loop through the products within the collection using the `for` loop and the `collection.products` array.

For example, to display a simple list of product titles within the collection, you could use the following code:

```liquid
{% for product in collection.products %}
  <h2>{{ product.title }}</h2>
{% endfor %}
```

Please note that advanced features like product sorting, filtering, and section sorting are not yet implemented in the current version of the theme.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cryptococo.gitbook.io/cocoshop-theme-development/architecture/templates/collection.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
