You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds a feature to allow editors to schedule publish / unpublish events
in the future. Must be enabled by setting
`versions.drafts.schedulePublish: true` in your Collection / Global
configs.
https://github.com/user-attachments/assets/ca1d7a8b-946a-4eac-b911-c2177dbe3b1c
Todo:
- [x] Translate new i18n keys
- [x] Wire up locale-specific scheduled publish / unpublish actions
Copy file name to clipboardExpand all lines: docs/versions/drafts.mdx
+15-4Lines changed: 15 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -19,10 +19,11 @@ _If Drafts are enabled, the typical Save button is replaced with new actions whi
19
19
20
20
Collections and Globals both support the same options for configuring drafts. You can either set `versions.drafts` to `true`, or pass an object to configure draft properties.
|`autosave`| Enable `autosave` to automatically save progress while documents are edited. To enable, set to `true` or pass an object with [options](/docs/versions/autosave). |
25
-
|`validate`| Set `validate` to `true` to validate draft documents when saved. Default is `false`. |
|`autosave`| Enable `autosave` to automatically save progress while documents are edited. To enable, set to `true` or pass an object with [options](/docs/versions/autosave). |
25
+
|`schedulePublish`| Allow for editors to schedule publish / unpublish events in the future. [More](#scheduled-publish)|
26
+
|`validate`| Set `validate` to `true` to validate draft documents when saved. Default is `false`. |
Payload provides for an ability to schedule publishing / unpublishing events in the future, which can be helpful if you need to set certain documents to "go live" at a given date in the future, or, vice versa, revert to a draft state after a certain time has passed.
173
+
174
+
You can enable this functionality on both collections and globals via the `versions.drafts.schedulePublish: true` property.
175
+
176
+
<Bannertype="warning">
177
+
**Important:** if you are going to enable scheduled publish / unpublish, you need to make sure your Payload app is set up to process [Jobs](/docs/jobs-queue/overview). This feature works by creating a Job in the background, which will be picked up after the job becomes available. If you do not have any mechanism in place to run jobs, your scheduled publish / unpublish jobs will never be executed.
178
+
</Banner>
179
+
169
180
## Unpublishing drafts
170
181
171
182
If a document is published, the Payload Admin UI will be updated to show an "unpublish" button at the top of the sidebar, which will "unpublish" the currently published document. Consider this as a way to "revert" a document back to a draft state. On the API side, this is done by simply setting `_status: 'draft'` on any document.
0 commit comments