Layouts & Partials
Edit page chrome and reusable partials from the admin — detach, reattach, or build from scratch.
Three theme primitives, all editable in the admin
Squilla exposes three editable theme primitives in the admin UI: layouts, layout blocks (partials), and content blocks. This page covers the first two; Content Blocks covers the lego bricks of node bodies.
What's a layout
A layout is the page-level chrome — the <html> wrapper, the head metadata, the site header / footer placement, and the slot where the node's blocks render. Examples: default, 2-col, landing, docs (the layout this very page is rendered with).
What's a layout block (a.k.a. partial)
A reusable fragment included from one or more layouts — site header, site footer, sidebar, breadcrumb. Conceptually they're partials; the legacy naming says "layout blocks". A rename is on the roadmap.
Manage at /admin/layouts
The list shows every registered layout with name, slug, source (theme / extension / user), assigned node types, and a preview thumbnail when available.
Three sources
- Theme-owned — read-only by default; comes with the active theme
- Extension-owned — read-only; an extension shipped this layout
- User-owned — fully editable; created in the admin or detached from a theme/extension
Detach
Click Detach on any theme/extension layout. The kernel copies the layout's template into a new user-owned row that overrides the source. From then on, your edits stick across theme reinstalls. Reattach deletes the user-owned override and falls back to the source.
Create from scratch
Hit New layout for a blank user-owned layout: name, slug, description, template_code (Go html/template), assignable node types.
<!doctype html>
<html lang="{{ .request.language }}">
<head>{{ template "head" . }}</head>
<body>
{{ renderLayoutBlock "site-header" }}
<main>{{ .node.blocks_html }}</main>
{{ renderLayoutBlock "site-footer" }}
</body>
</html>
Layout assignment
Each node type pins a default layout (configured in /admin/node-types). Per-node overrides live in the node edit screen's sidebar (Layout override picker). Resolution order at render time:
- Per-node override, if set
- Node-type default layout
- The theme's catch-all
defaultlayout
Layout blocks (partials)
Manage at /admin/layout-blocks. Same source model as layouts (theme / extension / user-owned, with detach + reattach). Each layout block has:
- Slug — the identifier used by
renderLayoutBlock "<slug>" - Name + description
- Template code (Go html/template)
- Field schema — page-level overrides; see below
Page-level field overrides
If a partial has a field_schema, every node using a layout that includes that partial gets a Layout block fields tab on its edit screen. Set the values for that page; the partial's template reads them as .partial.<field_key>.
This is the path for things like a per-page hero image override, a per-page CTA tweak, a per-page sidebar variant. Useful for marketing pages without forcing every change into the node's blocks_data.