[pmwiki-users] Creating a new page with GET/POST variables (or a form)

Hans design5 at softflow.co.uk
Fri Nov 9 14:42:35 CST 2007


Friday, November 9, 2007, 8:35:24 PM, alglt at yahoo.com wrote:

> So when the form is posted, the server at {$ScriptUrl} gets this:

> action=edit&template=Blog.Template&pagename=Blog.This+is+a+test

You can use a markup expression to turn the spaced title into a
pagename (I use this method now in FoxForum).
Markup expression 'wikiword' (Copyright D. Faure: Cookbook.MarkupExprPlus)
This needs PmWiki 2.2.0 beta

# for transforming author names into valid wiki words, with no spaces etc.;
$MarkupExpr['wikiword'] =
'preg_replace(array_keys($GLOBALS["MakePageNamePatterns"]),'
           . 'array_values($GLOBALS["MakePageNamePatterns"]),'
           . 'preg_replace($rpat, $rrep, $params))';

Then use it in your form to transform the string:

(:input form "{$ScriptURL}":)
(:input hidden action edit:)
(:input hidden template Blog.Template:)
(:input text pagename {(wikiword "Blog.This is a test")} :)
(:input end:)


  ~Hans




More information about the pmwiki-users mailing list