DocsTheme structure & publishing
On this page

Theme Updates

Publish improvements with confidence while keeping existing websites working. Frontbacked checks new theme versions from Git commits, file uploads, and editor publishing against the last accepted version.

Page Setting Defaults

Each theme version carries its own authored page-setting defaults. A newly created site receives the defaults from the version selected for that site, and its FRL endpoints can use them immediately through $page.

Untouched settings follow the selected theme version, including automatic updates, previews, and rollbacks. Admin edits remain saved, including deliberately empty lists or text. Reset a field or restore a whole list to follow theme defaults again. Edited lists stay together rather than merging with new default items. Older sites without edit history retain their saved values until reset.

Keep defaults consistent across pages that share a setting, preferably by using a shared component. See Page Setting Defaults for examples.

Keep Updates Compatible

A version is rejected only when it could corrupt data your sites already store, including:

  • Removing a post type or schema field, or changing a field's type.
  • Making existing fields required, unique, immutable, or more restricted.
  • Narrowing allowed values, file types, validation limits, or field visibility.
  • Changing the post type referenced by a field.

Everything else belongs to each version, so a site keeps what its version has: you can add, change, rename, or remove pages, components, routes in backend/paths.json, the settings your pages read, and FRL endpoints. The version history lists these as changes. Add new fields as optional to keep updates compatible.

Moving a site back to an older version is refused when that version is stricter about data than the one the site uses now, for example when it lacks a field the newer version added or allows fewer values. Data the site stored under the newer version could break under the older rules. Moving forward to newer accepted versions is always allowed.

Fix a Rejected Version

The theme's version history lists each detected breaking change with its post type or field. The last accepted version stays active; the rejected version is unavailable for site updates.

Restore compatibility and submit the corrected source. Editor drafts remain available after a rejected publish, so you can keep editing and try again. A Git rejection applies to that theme version; it does not undo your repository commit. Each theme root is checked independently.

If your design needs a different data structure or interface, create a separate theme. Breaking changes cannot be released as a new major version of the same theme.

The checks cover detectable theme contracts. Preview and verify your forms, permissions, scripts, and page behavior before releasing an update.

Adding required post fields

A new required scalar post field can be a minor update when it declares a valid fallback. Older posts missing that field use the fallback in reads, permissions, queries, and writes. A creation-only default does not provide that compatibility by itself.

An established fallback cannot change or disappear in a compatible update. Keep it stable and use default independently for future posts. See stable values for older records for supported field types and examples.

Required secrets when changing versions

Declare secrets after the FRL version line, with a name and description:

frl

Rule excerpt: add this to a complete FRL rule before running it. Try a complete example →

Every secret referenced in a file must be declared in that file before other rules. A missing declaration, name, or description prevents the version from being processed.

New sites show the required configuration form before their settings tabs. Owners can also choose Manage Secrets for their current version or any version they are reviewing. Values are saved securely for the site and reused across versions: $secret.serviceKey needs to be supplied only once.

Automatic updates keep the current version when a newer version needs a secret the owner has not supplied. The site page explains what is needed and offers Provide Details. After saving, owners can choose to upgrade immediately. Manual upgrades and downgrades also check required secrets before switching. Previewing a version does not require switching the live site.