Don't allow 'save and publish' for new content


Is there a way to prevent ‘save and publish’ being used for a new content item - so that new content is always created in draft, for approval and publish separately.

We’ve looked at the scripting options, but the operation and status fields look to be the same regardless of whether save or save and publish was pressed. In both case Operation is ‘create’ and status is ‘draft’, so something like this doesn’t work (adapted version of custom workflow in the docs)

if (ctx.status !== ‘Draft’) {
// If not reject this operation with a custom validation message.
reject(‘The status of a new article must be set to Draft’);

Is there a way to achieve this please? We are on the hosted version.

It depends on the workflow, you want that several transitions, e.g. from Draft to Workflow are only allowed for certain users. You can create a new workflow and customize it.

Thanks for the reply, is there any docs or examples as to how one would approach this with a workflow please? Specifically how you would restrict the content creator from publishing new content.

When you create a new workflow, a default config is used that also includes the Archived state. For sake of simplicity I have removed it now.

What you can do is something like this:

This is workflow that is only applied to article schemas and only Owner can move a content from Draft to Published. “Create and Publish” are two operations, therefore it is also applied to this action.

Thanks that’s done the trick.

Looking at the workflow editor, where you have step 2, step 3 etc - is the intention there so you can have an ‘approval ladder’ e.g. where you need to have multiple levels of content sign off? is my understanding correct here please?

Yes, I have customers with several stages. One team reviews the content, another team the spelling and grammar and another team checks the facts. So you have 3 review steps before a content gets published.

Ok cool, thanks for the help and confirmation

1 Like