# Templates

Templates define the overall structure and appearance of your store. A template ties together a header, footer, page definitions, and storefront layouts into a single deployable theme.

{% hint style="success" %}
**Need some examples?**

Check out Theme examples built by our team: [**Github repo**](https://github.com/LightspeedHQ/crane-example-themes)
{% endhint %}

{% hint style="info" %}
**Want to build public Theme?**

Make sure to go through [Design Site Themes](/site-themes/design-site-themes/introduction-to-designing-themes.md)section first
{% endhint %}

### Structure <a href="#structure" id="structure"></a>

Each template lives in its own directory under `templates/`:

```
templates/
├── my-store/
│   ├── configuration.ts     # Metadata, header, and footer
│   └── pages/
│       ├── home.ts          # Home page sections
│       ├── product.ts       # Product page (storefront)
│       ├── catalog.ts       # Catalog page (storefront)
│       ├── category.ts      # Category page (storefront)
│       └── about.ts         # Custom page
├── assets/                  # Shared template assets (cover images, etc.)
layouts/
├── product/                 # Product page layouts
├── catalog/                 # Catalog page layouts
└── category/                # Category page layouts
```

### Key Concepts <a href="#key-concepts" id="key-concepts"></a>

* **Configuration** — every template has a `configuration.ts` that defines its metadata (name, description, cover image), header section, and footer section. See [Configuration](/site-themes/develop-site-themes/templates/configuration.md)
* **Pages** — each `.ts` file in the `pages/` directory defines which sections appear on that page. File names map to page types: `home.ts`, `product.ts`, `catalog.ts`, `category.ts`, or any custom name. See [Pages](/site-themes/develop-site-themes/templates/pages.md)
* **Storefront Layouts** — storefront pages (product, catalog, category) require a corresponding layout that defines how the platform's built-in content areas are arranged using named slots. See [Layouts](/site-themes/develop-site-themes/templates/layouts.md)

### Scaffolding <a href="#scaffolding" id="scaffolding"></a>

Create a new template with the CLI:

```bash
npx @lightspeed/crane@latest init --template my-store
```

This generates the configuration file, page files for all built-in page types, and the required layout directories.


---

# Agent Instructions: 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://docs.ecwid.com/site-themes/develop-site-themes/templates.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.
