PmWiki | Cookbook / NewPageBoxPlus (original) (raw)

Summary: Adds customisable box plus button form for page creation

Version: 2023-02-14

Prerequisites: PmWiki 2.2.56 (compatible with PHP 5.5)

Status: Stable

Question

How can I provide a form or box to allow users to create new pages?

Answer

As with the original, this alternative script adds markup that places a simple box with a button. Filling in the box with a page name and pressing the button will create the page. Parameters (see below) allow for styling the box, button, setting page name, and page-creation behavior.

The newpageboxplus.phpΔ script provides a (:newpagebox:) markup which displays a simple box for creating pages:

(:newpagebox:)
(:newpagebox:)

To install, download newpageboxplus.phpΔ, copy into the cookbook folder, and add the following to config.php:

    `include_once("$FarmD/cookbook/newpageboxplus.php");`

This script can be used as an alternative to NewPageBox and should be installed instead of newpagebox.php.

This script adds additional functionality:

Use

Usage is the same as original script, by adding this markup to any wiki page:

(:newpagebox:)
(:newpagebox:)

Possible parameters to use inside the markup:

Optional config settings

$NewPageProtectedGroups

This is an array of protected groups, for which creation of new pages is prohibited. Default protected groups are 'SiteAdmin' and 'Site'.

$NewPageProtectedGroups[] = 'SpecialGroup';

adds 'SpecialGroup' to array of protected groups.

$NewPageBaseGroup = 'Main';

(example) all new pages will be created in 'Main' group (regardless of any base= parameter setting).

Examples:

New pages will be created in group "Test":

(:newpagebox base=Test.HomePage:)
(:newpagebox base=Test.HomePage:)

Small box with left "Go" button for use in sidebar:

(:newpagebox value="Create New Page" focus=true label=Go button=right size=16:)
(:newpagebox value="Create New Page" focus=true label=Go button=right size=16:)

Update History

Notes

See Also

Comments

See discussion at NewPageBoxPlus-Talk

User notes +7: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.