1

in my frontend entry form I have a "save as draft" submit button. The current action for this form is the following, which saves the entry submitted through the form as a draft (status: disabled):

<input type="hidden" name="action" value="entryRevisions/saveDraft">

Next to the "save as draft" button I would like to have a "publish" button. If the user clicks on it the entry should be submitted as "status: live". If the user clicks on "save as draft" it should be submitted as "status: disabled". Any idea how to do this?

1

I believe you're looking for entryRevisions/publishDraft:

<input type="hidden" name="action" value="entryRevisions/publishDraft">

You can see the specific inputs it is looking for here: https://github.com/craftcms/cms/tree/master-v2/src/controllers/EntryRevisionsController.php#L188

  • Hi Brad, thanks for your support. As I have two buttons in the form "save as draft" and "publish" I want the user to click either or. So either the forms content is being saved as draft or it is being published. – user5991 Dec 17 '16 at 7:32
  • Maybe something similar than this: <input type="submit" action="entryRevisions/saveDraft" value="Save as draft"> <input type="submit" action="entryRevisions/entries/saveEntry" value="Publish">. Unfortunately this is not working. Any idea how to make it work? – user5991 Dec 17 '16 at 7:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.