Drafts, publishing and version history
The team works on a draft; the website only shows what someone has published. Every save keeps a snapshot of the page or entry, called a version, so earlier states can be looked at, compared with the newest one and brought back. Two people (or a person and an AI assistant) editing the same thing at once cannot overwrite each other without noticing. This works the same for pages and for entries of every collection that has drafts.
What users can do
Editors and admins:
- Save a draft. In the page editor this happens by itself (autosave, 2 seconds after the last change, or Ctrl/Cmd+S). In the entry editor it is the Save draft button (or Ctrl/Cmd+S). Saving never changes the website.
- Publish the latest version: from the editor (Publish), or for several at once from the page or entry list (select rows, Publish). Unsaved changes are saved first.
- Unpublish: take a page or entry off the site. Its versions are kept. From the page list (row menu or bulk), or the entry editor's More actions menu, or the entry list (bulk).
- See the history: newest first, with who saved each version, when, its note, a Published badge on the live version and · latest on the newest.
- Open a version to see its content as an outline (for a page, each top element's tag or component and its first words; for a module's json field, what its module lists), and, for an older version, Changes since this version: what is different in the newest version.
- Restore an older version: it is copied into a new newest version. Nothing is published and no history is lost.
- Resolve a conflict when someone else saved in between (see below).
Automatically:
- Every save that changes something adds a version. Saving without changes adds none, so autosave does not flood the history.
- Changing a page's title, slug or SEO in its settings also saves a version. When the page was live without other pending changes, that version is published straight away, so the site follows.
AI assistants save drafts only and never publish. Their changes appear in the same history and on the AI changes screen, where a person can review and revert them; see AI assistants.
Collections without drafts have none of this: a save is live at once, there are no versions, no history and no publish or unpublish (see Collections and entries).
Who may do it
| Action | Permission | Roles |
|---|---|---|
| Save a page draft, restore a page version | collections.website-pages.update | admin, editor, ai |
| Create a page (first version) | collections.website-pages.create | admin, editor, ai |
| Publish or unpublish a page | collections.website-pages.publish | admin, editor |
| Page history, open and compare versions | collections.website-pages.read | admin, editor, ai |
| Revert an AI change | collections.website-pages.update, and not an AI user | admin, editor |
| Save, restore an entry version | collections.<slug>.update | admin; editor by default |
| Publish or unpublish an entry | collections.<slug>.publish | admin; editor by default |
| Entry history, open and compare versions | collections.<slug>.read | admin; editor by default |
- "Editor by default": a collection can narrow what editors may do; otherwise editors get every permission.
- ai: only what a collection gives it. The website module gives it
read,createandupdateon pages and posts (drafts only, never publish) andreadon the header, footer and navigation. Other collections opened to AI assistants are reachable as drafts only (AI assistants). - Saving an entry's text in another language needs the collection's
update. The website module's page rules (no path the site uses itself, one item template per collection) hold however a page is saved. - AI users hold
collections.website-pages.update, which restoring needs, but cannot restore: they cannot sign in to the admin, and none of their tools restores. - In the admin, Publish and Unpublish are hidden or disabled without the publish permission, and Restore is hidden without the update permission.
In the admin
Page editor
The top bar shows the save state, with these labels: No changes, Unsaved changes, Saving…, Saved, Changed elsewhere and Save failed. Next to it are an Unpublished changes badge (when the latest version is not the live one), the History button, Preview and Publish.
- Autosave: every change is saved 2 seconds later. Changes made while a save is running are saved next. Leaving the editor or closing the tab saves pending changes first. A failed save with field problems keeps the page unsaved and marks the problems.
- Publish saves pending changes, publishes the latest version and shows "Published / The site will rebuild." If the version cannot be published, the problems are shown and the editor selects the element of the first problem.
- Conflict dialog "Someone else saved this page": opens when a save is refused because the page changed elsewhere. Autosave stops until it is resolved. Choices: Copy my content (the page's content on the clipboard), Reload their version (your changes are lost) or Overwrite with mine (saves your content on top of theirs as a new version; theirs stays in the history). Clicking Changed elsewhere reopens it.
- In another language the same autosave and conflict guard apply; the history then loads versions in that language.
Entry editor
- Header: a status badge (Unsaved, Unpublished changes, or draft/published), Save draft (just Save for collections without drafts), Publish / Publish changes / Published (see Entry editor), and More actions with History (once the entry has a version) and Unpublish (when it is published).
- No autosave. A guard asks before leaving with unsaved changes.
- Conflict: the dialog "Someone else saved this entry" offers what the page editor does: Reload their version (unsaved changes are lost), Overwrite with mine (saved on top of theirs, which stays in the history) and Copy my content; or cancel to keep editing.
Lists
- The page list and each collection list: status badges (published / draft, plus Changes when a published item has unpublished changes), status filter, and row and bulk Publish / Unpublish. Bulk unpublish only acts on the selected items that are published.
Version history panel
A slide-over titled Version history, shared by pages and entries:
- 20 versions at a time, Load older versions for more. Each row: time ago (full date on hover), author (Unknown when the user is gone or it was the system) and note.
- Clicking a row opens it. The newest version shows only its outline. An older one also shows Changes since
this version, comparing it with the newest version:
- entries: field by field, in field order, with labels such as "SEO › SEO title". A json field lists its changes as the module that checks it describes them (the website module: a page's content node by node); one whose module describes none, or is switched off, and any other field (text, repeater, relation, link…) is shown as Changed as a whole;
- pages: field by field too, so a change of title, slug or SEO shows, and the content node by node. Each element, text or component is Added, Removed, Moved or Changed, and a changed one names what changed (its text in a language, an attribute, a property). A node counts as moved only when its parent changes or its order among the siblings it kept changes: adding or removing a node moves no other. Under them the website module notes that styles and animations are kept with the site, not in versions;
- "Same as the latest version." when nothing differs.
- Versions are loaded in the language being edited, so translated text is compared too.
- Restore (all rows except the newest) asks "Restore this version?" and then copies it into a new version. The editor reloads to show it. Before restoring, the page editor first saves what autosave has not sent yet; the entry editor asks before replacing unsaved changes. When someone saved in between, the panel says "Someone else saved in the meantime".
On the website
- The site only ever reads published versions: for pages the slug, title, SEO and content all come from the published version, never from the draft.
- Publishing and unpublishing rebuild the site when the collection is public (pages are). The change is visible once the rebuild is done. Unpublishing an item that was not published does nothing.
- Collections without drafts are live at once: creating, saving or deleting rebuilds the site.
- Drafts can be seen through Preview: a link that works for 10 minutes.
- A page that goes live under a new slug leaves a redirect from its old path; see Redirects.
Rules and limits
Drafts versus published content.
- A draft may be incomplete: required fields may be empty.
- Publishing checks the version strictly: required fields, the page's content, every reference still existing, and alt text on images. Otherwise it is refused with "This version cannot be published yet" and the problems.
- Publishing with no version yet is refused ("Nothing to publish yet: save first").
- The admin always publishes the latest version. To publish an older one, restore it, then publish.
- "Unpublished changes" means the latest version is not the published one.
Conflict guard.
- Every save and restore remembers which version the editor started from. If someone else saved since, the save is refused with "This page was changed by someone else. Reload to see their changes." (the item's name instead of "page").
- AI assistants are held to the same guard. A person with the editor open then gets the conflict on their next save.
Unchanged saves. If nothing changed, no version is added. In another language, only that language's text is compared.
Versions hold all languages. A version holds the default language and every translation. Saving one language keeps the others in the new version; restoring brings back every language as it was then.
Restore.
- Copies an old version into a new newest version; history is never rewritten.
- Checked as a draft against today's fields and components; references that no longer exist are refused.
- Never publishes.
- Always adds a version, even when the old version equals the newest. Restoring the version that is already the newest adds nothing.
Notes. Optional, at most 200 characters. Notes the system writes:
| Note | When |
|---|---|
Created | first version, unless a note was given |
Translated (<code>) | a save of another language without a note |
Updated page settings | title, slug, SEO or template changed in page settings |
Updated page settings (slug was "<old>") | the same, with a new slug on a published page |
Restored from <YYYY-MM-DD HH:MM> (<author>) | restore; time in UTC, author when known |
Created by AI / Updated by AI | AI assistants' collection tools; their page tools pass the AI's own note |
Normal saves from the team carry no note. A note given when publishing is kept in the audit log: "Published page "Prijzen": Prijzen voor 2027".
Deleting an item deletes all its versions. Old versions never block deleting media or other items they mention: their reference is emptied instead.
Retention. Versions are kept until the item is deleted, but old ones are thinned out by retention: versions older than two years by default (at least 30 days, adjustable), never an entry's latest or published version.
For developers
The code and its tests: shade/features/entries/README.md in the shade repository.