How do you work with drafts of already created posts?

Back to the topic, drafts. I have an idea for a possible solution.

Idea

I don’t really see a reason to have more than one draft to each page.

My idea is based on that there is only two states, one original and one draft. You have one published version online and you have one unpublished version that will be online some time in the future.

Screenshot 1

Explaining the screenshot:

  • A switcher on top. Green in this mockup could be the active choice.
  • Switching to the original will give the same fields but probably another content.

Screenshot 2

This screenshot is all about trying to show how the content is stored. It’s the same fields but they are duplicated.

The benefits of having the draft content saved to the same page are these:

  • The delete page still works because there are still no subpages to delete first.
  • The preview button will still work like before and to show the draft a possible solution could be to add ?state=draft to the frontend page url.
  • There would be no need for excluding pages in collections.
  • There would be no need for using routes to have error pages to the drafts, because there are no drafts pages.
  • A draft is a version of the current page. In that context it would not be a logical choice to have a new page as a draft.

Pitfalls

  • The content text files will be larger, but by adding a hook to remove duplicate fields it would only need to keep the modified fields.
  • As far as I know the blueprints don’t handle logic at all. It would require to figure out a way to duplicate the fields automatically before the blueprint is loaded.

Feedback?

1 Like