25 lines
1.5 KiB
Plaintext
25 lines
1.5 KiB
Plaintext
---
|
|
title: Drafts
|
|
label: Drafts
|
|
order: 20
|
|
desc: Enable drafts on collection documents or globals and build true preview environments for your data.
|
|
keywords: version history, drafts, preview, draft, publish, autosave, Content Management System, cms, headless, javascript, node, react, express
|
|
---
|
|
|
|
Payload's Draft functionality builds on top of the Versions functionality to allow you to make changes to your collection documents and globals, but publish only when you're ready. This functionality allows you to build powerful Preview environments for your data, where you can make sure your changes look good before publishing documents.
|
|
|
|
<Banner type="warning">
|
|
Drafts rely on Versions being enabled in order to function.
|
|
</Banner>
|
|
|
|
All Payload APIs will also expose [a new option](/docs/overview/versions/drafts#api) called `draft` which allows you to control if your document update(s) should be considered as draft or written straight to the published document.
|
|
When you enable versions _and_ drafts, the Admin UI will update itself to include both "Save Draft" and "Publish Changes" buttons instead of a single "Save" button.
|
|
|
|
### TODO:
|
|
|
|
- Options
|
|
- need header for `#api`
|
|
- access control example to describe how to limit people from viewing drafts
|
|
- talk about ?draft=true, how you can deliberately ask for newer drafts for docs and they will be sent back accordingly automatically
|
|
- talk about how Global `read` access control accepts an additional argument for `draft` which is a boolean and you can use it to prevent / allow reading globals if they are drafts
|