Is there a way to schedule a draft of a entry to go live?
1 Answer
If the entry is not already published, just set the Post Date
to a date in the future.
That will set the entry to what Craft calls Pending
. On the entry's index, the status indicator will be orange (instead of green).
If the entry is already currently published, no. That'd be a feature request. I agree, it would be great to be able to "publish over" the current edition (say for a contest or what not). If you set a draft's entry to a future date, Craft will un-publish the entry and set the status to pending.
You could work around this in Twig though. Say you want to have the entry change on 11/10. Set up a new Draft, name it Will Go Live on 11/10
(or whatever). Then in your template:
{% if now|date('U') > "2015-11-10"|date('U') %}
{% set theDrafts = craft.entryRevisions.getDraftsByEntryId(entry.id) %}
{# keep the "old" entry around just in case #}
{% set oldEntry = entry %}
{%for i in theDrafts %}
{# look for the specific draft and set if it exists #}
{% if i.name == "Will Go Live on 11/10" %}
{% set entry = i %}
{% endif %}
{% endfor %}
{% endif %}
{# template as normal #}
...
-
1Thank you for your response. The latter is the use case I am looking for... especially for single entries.– TaylorNov 4, 2015 at 1:49