Forums / Cotonti / General / Question about draft articles

Is it possible to make draft like saves

tensh
#22443 2010-01-29 20:58
A page has "page_key". If a "page_key" is 'system', then it's not displayed anywhere, for example. And old weblog plugin used "page_key" for marking weblog pages (it wrote "_weblog_page" in "page_key").

So you can make a plugin that will sign drafts as 'page_key' = 'draft'.
Additionally, create 2 additional page extra fields: 'page_masterid' (int) and 'page_hasdraft' (tinyint (1)), in which you'll fill in the id of a page on which the draft is based on, and you'll mark the page for which the draft was made.

This way one page can have multiple drafts which you'll call in plugin interface by page id.
1. Select pages that have page_hasdraft = 1
2. Foreach of the above, select pages that have 'page_key' = 'draft' and 'page_masterid' = 'id of the mother page'.

Hope that's clear... o_O

Added 4 minutes later:

Of course the logic behind drafts is more complex (like decide whether you can make drafts out of other drafts, or not), but I think it can be made as a plugin.