3

I have a client who wants to use an author (draft) -> editor (publish) workflow.

It appears that authors can update existing entries which will create a new draft of the entry. As an editor, I can then visit the edit page for that entry and select the new draft from the "revisions" drop-down.

This is great if I know that a new draft is waiting to be reviewed, but I couldn't find a way to discover which entries have new drafts.

Is there a way to view which posts have new drafts from the entries index? Otherwise what is the normal practice for editor-type users to know which entries have pending changes?

Thanks in advance!

1 Answer 1

3

Craft definitely doesn't give you these filtering tools when viewing a list of entries, but the building blocks exist within the framework to allow you to build your own solution. The most straightforward way I can think of would be to create a plugin with its own CP section and show the outstanding drafts there.

You can get a list of all drafts with this little bit of PHP:

EntryDraftRecord::model()->findAll();

If you expose the list of drafts using a Template Variable, you could then display links to each of them by doing this:

{% set drafts = craft.myPlugin.getAllDrafts() %}

<ul>
{% for draft in drafts %}
    {% set draftEntry = craft.entries.getEntryById(draft.entryId)|first %}
    <li>
      <a href="{{ draftEntry.getCpEditUrl() }}">{{ draftEntry.title }}</a>
    </li>
{% endfor %}
</ul>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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