[pmwiki-users] Creating a new page with GET/POST variables (or a form)
alglt at yahoo.com
alglt at yahoo.com
Fri Nov 9 15:07:52 CST 2007
Hans (2007-11-09 20:42):
> 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
>
>
Thank you for the suggestion and clarification. I'll try it out a
little bit later.
--
Algardas
still confused as to why http://pmwiki.org/?pagename=This+is+a+test
works as expected...
More information about the pmwiki-users
mailing list