Drafts

PmWiki has the capability to stage draft versions of a page prior to them becoming "official". All of the draft pages end in "-Draft" by default (this can be changed by setting $DraftSuffix). Multiple interim edits to a page can be temporarily saved in a "-Draft" copy of a page until the draft is ready to be published to the original. When the site administrator sets $EnableDrafts in a local customization file, the "Save" button on the edit page is split into separate "Publish" and "Save draft" buttons.

The "Save draft" button causes any edits to be saved to a "-Draft" copy of the original page, leaving the original page intact. Subsequent requests to edit the page (either the original or -Draft) bring up the draft copy for further editing.

The "Publish" button saves back to the original non-Draft copy of the page, removing any -Draft page that may have been created.

By default, saving drafts and publishing are available to anyone with 'edit' permissions (see Passwords). However, the site administrator can also set the $EnablePublishAttr configuration variable, which provides a separate 'publish' permission that is required to publish to the original page. When "publishing", how the page's history is handled depends on whether the administrator has set the $EnableDraftAtomicDiff variable.

• When set to 1, "publishing" a draft version will clear the "draft" history, leaving a single "diff" between the latest and the previous "published" versions. Note that this will delete the author names, dates and contributions of the intermediate, unpublished versions, so the change "Summary" you enter should summarize the changes.
• Otherwise, all of the "draft" history entries are kept. The final "publish" history entry will show changes since the most recent "draft" version.

Start by enabling drafts to change the "Save" button into separate "Publish" and "Save draft" buttons. Then set \$EnablePublishAttr. This adds a "publish" authorization level to distinguish editing of page drafts from publishing.