The `collection` template renders the collection page, which lists all products within a collection.
> Tip:
> Refer to the [collection template](https://github.com/Shopify/dawn/blob/main/templates/collection.json), its [banner section](https://github.com/Shopify/dawn/blob/main/sections/main-collection-banner.liquid), and its [product grid section](https://github.com/Shopify/dawn/blob/main/sections/main-collection-product-grid.liquid) in Dawn for an example implementation.
## Location
The `collection` template is located in the `templates` directory of the theme:
```text
└── theme
├── layout
├── templates
| ...
| ├── collection.json
| ...
...
```
## Content
You should include the [collection object](#the-collection-object) in your `collection` template or a section inside of the template.
### The collection object
You can access the Liquid [`collection` object](/docs/api/liquid/objects/collection) to display the collection details.
## Usage
When working with the `collection` template, you should familiarize yourself with the following:
- [Filtering collections](#filter-collections)
- [Sorting products in a collection](#sort-products-in-a-collection)
- [Paginating products](#paginate-products)
> Tip:
> If you're using a JSON template, then any HTML or Liquid code needs to be included in a [section](/docs/storefronts/themes/architecture/sections) that's referenced by the template.
### Filter collections
You can use [storefront filtering](/docs/storefronts/themes/navigation-search/filtering) to filter collections into smaller subsets of products.
### Sort products in a collection
You can choose the order that products are sorted in through the `sort_by` URL parameter on collection pages:
Through the [collection object](/docs/api/liquid/objects/collection), you can access the following:
- The available options with the `sort_options` attribute.
- The currently selected option, if one is selected, with the `sort_by` attribute.
- The default option with the `default_sort_by` attribute.
You can output the available options in a `