# 主题 template 概述

> Template 如何决定 Shoplazza 主题中每种页面类型的渲染内容、模板文件放在哪里，以及页面类型与 template 的对应关系。

Template 控制 theme 中每种页面类型的渲染内容。

在线商店中的每种页面类型都有对应的 template 类型。您可以利用 template 为该页面类型添加合适的功能。例如，您可以在 product template 中添加额外的商品推荐内容。

## 位置

Template 文件位于 theme 的 `templates` 目录下：

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

## 子类型

您可以在 theme 中使用 Liquid [文件类型](/docs/theme/architecture/templates/overview#文件类型)。该 template 文件类型可用于构建多种 [template 类型](/docs/theme/architecture/templates/overview#template-类型)，每种类型代表商家在线商店中的一类内容。

### 文件类型

Template 类型仅支持 Liquid 文件类型。

| 类型   | 描述                                                                                            |
| :----- | :---------------------------------------------------------------------------------------------- |
| Liquid | Liquid template 是使用 [Liquid](/docs/theme/references/liquid/) 标记语言编写的文件，扩展名为 `.liquid`。 |

### Template 类型

每种可用的 template 类型代表商家在线商店中的一类内容。所有 template 类型均非必须。但您必须为想要渲染的每种页面类型配备一个匹配的 template。例如，要渲染商品页面，您至少需要一个 `product` 类型的 template。

您可以在 theme 中使用以下 template 类型。点击 template 名称可了解详细信息。

| 类型                                                                       | 描述                                                                                                                                                                      |
| :------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [404](./404)                                            | 渲染当客户输入无效商店 URL 时显示的页面内容。                                                                                                                             |
| [article](./article)                                    | 渲染文章页面，其中包含文章的完整内容。该 template 适用于博客中的单篇文章等内容。                                                                                          |
| [blog](./blog)                                          | 渲染博客页面，列出博客中的所有文章。                                                                                                                                      |
| [cart](./cart)                                          | 渲染 `/cart` 页面，提供客户购物车内容的概览。                                                                                                                             |
| [collection](./collection)                              | 渲染专辑页面，列出专辑中的所有商品。                                                                                                                                      |
| [customers/addresses](./customers-addresses)            | 渲染客户地址页面，允许客户查看和管理已保存的地址，以及添加新地址。                                                                                                        |
| [customers/login](./customers-login)                    | 渲染客户登录页面，包含登录客户账户的表单。                                                                                                                                |
| [customers/order](./customers-order)                    | 渲染客户订单页面，显示客户历史订单的详细信息。                                                                                                                            |
| [customers/register](./customers-register)              | 渲染客户注册页面，包含创建客户账户的表单。                                                                                                                                |
| [customers/reset\_password](./customers-reset-password) | 渲染密码重置页面，包含重置客户账户密码的表单。                                                                                                                            |
| [customers/reset\_success](./customers-reset-success)                   | 渲染密码重置成功页面。                                                                                                                                                    |
| [index](/docs/theme/architecture/templates/)            | 渲染商店首页，位于根 URL（`/`）。                                                                                                                                         |
| [order](./order)                                                     | 渲染客户订单详情页面，显示客户历史订单的详细信息。                                                                                                                        |
| [order\_verify](./order-verify)                                        | 渲染订单查询页面，可通过邮箱或手机号查询订单。                                                                                                                            |
| [page](./page)                                          | 渲染商店的静态页面，例如**关于我们**和**联系我们**。                                                                                                                      |
| [password](./password)                                                 | 渲染 `/password` 页面，即为在线商店设置密码保护后显示的落地页。该页面包含一条可由商家编辑的提示信息，以及供客户输入密码进入商店的密码表单。                                |
| [product](./product)                                    | 渲染商品页面，包含商品的媒体内容和详细信息，以及供客户选择 variant 并加入购物车的表单。                                                                                   |
| [search](./search)                                      | 渲染 `/search` 页面，显示店面搜索结果。                                                                                                                                   |
