Templates & Sections

Content

Templates & Sections

Templates define page layouts by combining reusable sections. Learn how to compose pages modularly and manage section structures.

How Templates Work

Composable page layouts

A template is a page layout built from one or more sections. Think of it as a blueprint that defines which content blocks appear on a page and in what order.

For example, a "Homepage" template might contain:

  • Hero section
  • Features section
  • Testimonials section
  • CTA section

Templates are assigned to post types. When a user creates a new post, they select a template, and the editor shows all the sections defined in that template.

Creating Templates

Build your page blueprint

To create a template:

  • Go to Templates in the sidebar
  • Click "New Template" and give it a name
  • Add sections from your section library
  • Drag to reorder sections as needed
  • Assign the template to one or more post types

You can also mark a template as dynamic, which is useful for templates that should adapt based on the content or context.

Understanding Sections

Reusable content components

A section is an independent content block with its own data structure. Sections are the building blocks of templates.

Each section has:

  • Title — a display name (e.g., "Hero Banner")
  • Key — a unique identifier in SCREAMING_SNAKE_CASE (e.g., "HERO_BANNER")
  • Structure — the fields and their types, defined in the Section Builder
  • Thumbnail — an optional preview image

Sections are reusable across templates. If you create a "Contact CTA" section, you can include it in your Homepage template, About template, or any other template.

Section Types

Different section purposes

Svalla supports different section types for different purposes:

  • Page sections — standard content sections used in page templates (hero, features, testimonials, etc.)
  • Form sections — sections that contain form configurations for collecting user input
  • Content Type sections — sections linked to content types for structured data
  • Property sections — sections for managing post properties and custom fields

Most of the time you'll work with page sections, which are the content blocks that make up your website pages.

Template Assignment

Connecting templates to content

Templates are connected to post types. A post type can have multiple templates, giving editors a choice of page layouts:

  • A "Blog" post type might have templates for "Standard Article", "Photo Essay", and "Video Post"
  • A "Pages" post type might have "Full Width", "Sidebar Layout", and "Landing Page"

When creating a new post, the editor selects which template to use. The template determines which sections appear in the content editor and what fields are available.

Per-Page Section Control

Enable or disable sections per page

Even though a template defines a set of sections, each individual page can enable or disable specific sections. This means:

  • A page using the "Homepage" template can hide the "Testimonials" section if there are no testimonials to show
  • Disabled sections are not returned by the API, keeping responses clean
  • The section structure remains intact — you can re-enable it at any time

This gives editors flexibility without needing to create separate templates for every variation.