EditPreview

<< | Cookbook-V1 | >>

Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.


Goal

Provide a way to preview the contents of a page being edited before saving the changes.

Solution

This script adds a Preview button to the Edit page, for PmWiki/PmWiki versions 0.5 and above.

Attach:preview.php - source code

Discussion

PmWiki versions 0.5.21 and later already have page preview capabilities integrated. This page is provided for historical reference.

Put preview.php in your local directory and add the line include_once("local/preview.php") to local.php.

The script redefines the default page headers and footers to make it clear that this is a preview. Deleting these lines will cause PmWiki/PmWiki to display the standard headers and footers. All directives (noheader and so on) work as expected in the Preview.

<#>? implemented this feature in pmwiki-0.5.21, but this was an interim solution provided for versions of PmWiki from 0.5.0 to 0.5.20.

Modified 29 July 2003 to add Page is unsaved to the default page header.

Contributors

pmwiki-2.3.32 -- Last modified by {{}}?

from IP: 85.171.160.186 ip should be disabled by default for security reasons