**`resolveTemplate(string $name): string`** — in `helpers.php`. This is the single resolution function used throughout the framework.
1. Check `custom/templates/{name}.php`
2. Fall back to `app/default/templates/{name}.php`
The three core templates (`base`, `page`, `list`) are resolved at context creation and stored in `$ctx->templates`. Other docs reference this section for resolution behavior.
### List Template Override
In `metadata.ini`:
```ini
[settings]
page_template = "list-grid"
```
Resolution for list template override (in `router.php`, at render time):
1.`custom/templates/{page_template}.php`
2.`app/default/templates/{page_template}.php`
3. Fall back to `$ctx->templates->list` (the default resolved at context creation)
### Default Templates Provided
| Template | Purpose |
|---|---|
| `base.php` | HTML document scaffold |
| `page.php` | Single page wrapper (`<article><?= $content ?></article>`) |
| `list.php` | Default list with cover images, dates, summaries |
| `list-compact.php` | Minimal list variant |
| `list-grid.php` | Card grid layout |
## Template Variables
Variables are injected via `extract()` — each array key becomes a local variable.
### base.php Variables
| Variable | Type | Always Set | Description |
|---|---|---|---|
| `$content` | string (HTML) | yes | Rendered output from page.php or list template |
| `$pageTitle` | ?string | yes | Page title (null if unset) |
| `$metaDescription` | ?string | no | SEO description |
| `$socialImageUrl` | ?string | no | Cover image URL for og:image |
Items sorted by date — direction controlled by `order` metadata on parent (`descending` default, `ascending` available).
**Asset URLs vs page URLs:** Item `url` uses the translated slug. Asset paths (`cover`, `pdf`) use the actual folder name, ensuring assets resolve regardless of language.