I have a front end form where I set have

<input type="hidden" name="enabled" value="1">

I also need to set the postDate to a date in the future. Does setting enabled = 1 reset the postDate in all cases? Or should I just forego the enabled form field altogether in favor of Setting postDate?


Setting enabled = 1 will not alter your postDate.

If you were to set a postDate in the future, the entry would simply not show up (by default). However, if you'd want enabled entries with a future postDate to show up in your template results, use:

{% set futureEntries = craft.entries.status('pending') %}

If you do not use the status criterium, it will default to live, which is all enabled entries with a postDate in the past. So, it all depends on how you display the entries, not so much on how you save them.

Also, see this Craft docs information on status.

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.