[development] Use revisions to replace previews

Angela Byron drupal-devel at webchick.net
Thu Jun 7 19:55:00 UTC 2007


On 7-Jun-07, at 3:47 PM, Karthik wrote:

> On 08/06/07, David Strauss <david at fourkitchens.com> wrote:
>> With clever use of revisions, we could eliminate the preview system
>> entirely from the codebase.
>>
>> Here's how it would work. If a user clicks Preview, it creates a new
>> revision but does not mark it as the current revision. The preview  
>> seen
>> is the new revision rendered. If a user clicks Save, it creates a new
>> revision *and* marks it as the live one. Optionally, we could then
>> delete the interim preview revisions.
>>
>> Another advantage to this is that a user can work on a node,  
>> preview it,
>> and have their work saved. If a user comes back and edits the node  
>> with
>> unsaved previews, they can choose to work from the latest preview  
>> or the
>> latest public revision.
>
> Excellent idea. IIRC, a similar approach was taken for a  "save draft"
> (automatically) patch which was proposed a while back. While most of
> the emphasis was on "private drafts", the idea of "public drafts" is
> particularly ... juicy.

There might be code in revision_moderation module that could be re- 
used for this. Or it might be some gigantic hack. ;) Anyway, that  
lets you leave the existing node contents pubilshed while new  
revisions exist.

Previews as revisions sounds like a nice solution to the draft  
problem, imo.
-Angie



More information about the development mailing list