= htmlspecialchars($metadata['title']) ?>
= $content ?>
# Templates Templates control how content is presented. FolderWeb uses plain PHP templates — HTML with embedded PHP for dynamic output. ## Template Types FolderWeb has three template levels: ### Base Template (`base.php`) The HTML scaffold wrapping every page. Contains `
`, navigation, footer, and a `$content` placeholder for the inner template. ### Page Template (`page.php`) Wraps single-page content. Receives the rendered content and metadata. ### List Templates (`list.php`, `list-grid.php`, `list-compact.php`) Displays collections of items from subdirectories. Receives an `$items` array and optional intro content. ## Template Location Templates live in `custom/templates/`: ``` custom/ └── templates/ ├── base.php # HTML scaffold ├── page.php # Single page wrapper ├── list.php # Default list layout ├── list-grid.php # Grid card layout └── list-compact.php # Compact list layout ``` FolderWeb falls back to `app/default/templates/` for any template not present in `custom/`. ## Base Template The base template wraps every page. Here is a minimal example: ```php= htmlspecialchars($item['summary']) ?>
= htmlspecialchars($item['summary']) ?>
= htmlspecialchars($metadata['summary']) ?>
``` **Keep logic minimal.** Templates should display data, not process it. Complex logic belongs in plugins. **Use semantic HTML.** Prefer `