Templates
Blade templates with two variables, $entry and $site, plus a handful of helpers for images, menus, forms and settings.
Each published page renders views/{blueprint handle}.blade.php with two variables: $entry (the page) and $site. Site views live in the site:: namespace, and views/404.blade.php is the not-found page.
The layout
<!doctype html>
<html lang="en-GB">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
@seo
@analytics
<link rel="stylesheet" href="{{ $site->asset('app.css') }}">
</head>
<body>
<x-header />
<main>@yield('content')</main>
<x-footer />
</body>
</html>
@seo writes the whole head block: title, description, canonical, Open Graph, robots and structured data, so don't write those tags by hand. @analytics comes straight after it on every layout.
@extends('site::layout')
@section('content')
<h1>{{ $entry->title }}</h1>
{{ $site->image($entry->get('photo'), sizes: '100vw', class: 'aspect-[16/9] w-full object-cover') }}
@foreach ($site->related($entry, 'people') as $person)
<x-person-card :person="$person" />
@endforeach
@endsection
The page: $entry
$entry->get('field'): a field's value, or null when missing. Always use this, never$entry->data$entry->title,$entry->slug,$entry->path,$entry->published_at$entry->url(): the page's address, such as/offices/cardiff/
Values are as stored: a date is "2026-03-14", a select is the option's value, a repeater is a list of rows and a boolean is true or false. Rich text is sanitised when saved and output unescaped with {!! !!}; everything else is output with {{ }}.
The site: $site
$site->entries('office'): every visible entry of a blueprint, in the client's order$site->entry('about/team'): one entry by its path, or null$site->related($entry, 'people')and$site->relatedFrom($entry, 'office'): relations in both directions$site->image($value, sizes:, class:, loading:, alt:): a responsive<picture>in AVIF and WebP, cropped around the client's focal point$site->media($value): the file behind a media field, for documents and custom markup$site->asset('app.css'): a file inassets/, with a version stamp$site->form('contact'),setting('company.phone'),menu('main')
$site->entries() and $site->related() rather than queries of your own, which don't apply that rule.Where templates run
Every page is rendered in an isolated container: previews, render_page, promotion's check and the published build alike. It's the same code path each time, so what you preview is what's published. The container is given the version's own files (views, components, assets, blueprints, site.json), read-only, and a copy of this site's content as the page may show it: its pages, menus, settings, media and domains. A preview of a draft or change set includes those changes. Nothing else. In practice:
- Content comes from
$site,$entry,setting()andmenu(). Queries of your own only ever see this site's content (and skip the live-only rule above); there's no other data to reach: no other sites, no accounts, no enquiries. - No network. A template can't call an API or fetch a feed or image while it renders. Fetch it in the browser with JavaScript, or put it into the site's content.
- No server configuration.
env()andconfig()hold nothing about the platform or its services. Settings are how a site carries its own values (setting('company.phone')). - Nothing is kept between renders. The container can't write files that outlive the render, and each build starts afresh.
- Time and memory are limited. A page that loops forever or builds something huge fails the build with its own error.
Tailwind compiles your stylesheet in the same container, so @plugin and @config files run there too, under the same limits. When a page fails, the error names the template file and line.
Components
views/components/card.blade.php is <x-card>, and views/components/forms/input.blade.php is <x-forms.input>. They take @props, and $site is available inside them.
Menus
The client edits menu items; you decide the markup. Each item has label, url, newTab, children, and isCurrent (this page) and isActive (this page or one inside it). Items for pages that aren't live drop out on their own.
<nav>
@foreach (menu('main') as $item)
<a href="{{ $item->url }}"
@if ($item->isCurrent) aria-current="page" @endif
@class(['active' => $item->isActive])>{{ $item->label }}</a>
@endforeach
</nav>
Templates must cope with empty fields
A new entry has nothing filled in, and a required setting that's unset is flagged in the panel, not enforced. Wrap optional parts in @if, and cast possibly-null values passed to @section: @section('title', (string) $value).