# collection

> Shoplazza 主题的 collection template 渲染分类页并列出该分类下的全部商品，本页讲文件位置与应引用的对象。

`collection` template 渲染专辑页面，列出专辑中的所有商品。

## 位置

`collection` template 位于 theme 的 `templates` 目录下：

```text title="目录"
└── theme
    ├── layout
    ├── templates
    |   ...
    |   ├── collection.liquid
    |   ...
    ...
```

## 内容

您应该在 template 的 section 中包含 [collection 对象](#collection-对象)。

### collection 对象

您可以访问 Liquid [collection 对象](/docs/theme/references/liquid/objects/collection) 来显示专辑的详细信息。

## 使用说明

使用 `collection` template 时，您应该熟悉以下内容：

* [筛选专辑](./collection#筛选专辑)
* [分页显示商品](./collection#分页显示商品)

### 筛选专辑

您可以使用[店面筛选](/docs/theme/theme-features/site-navigation-and-search/filtering/)将专辑筛选为更小的商品子集。

### 分页显示商品

商品可以通过 [collection 对象](/docs/theme/references/liquid/objects/collection)的 `products` 属性获取，您应该对专辑的商品进行[分页](/docs/theme/references/liquid/objects/paginate)处理，以确保所有商品都可以访问：

```lua title="示例"
{% paginate collection.products by 20 %}
  {% for product in collection.products %}
    <!-- 商品信息 -->
  {% endfor %}
{% endpaginate %}
```
