[pmwiki-users] Create New Page Form

Petko Yotov 5ko at free.fr
Sat Jan 6 13:33:39 CST 2007


On Thursday 04 January 2007 21:33, Sivakatirswami wrote:
> I would like to put a small form on the "home page" of a group
>
> e.g. Project.Project
>
> which is a simple, single  input field, that the user fills in, then
> clicks button "Submit" (or "Create") and a new page in the group is
> generated, taking him to the edit window since it does not exist  yet.
>
> the  UI would  look like this:
>
> ========
> Please check existing pages for one that already
> serves your need. If none exists, create a new page below.
>
> Create New Project Page:
> ____________________ # being a single input  field)
>
> [Create] # being a button
>
> and the action triggers:
>
> http://wiki.hindu.org/seva/index.php/Slideshows/AjaxAlternatives?action=edi
>t
>
> where the  user can then create his new page...

You can use such markup:

(:input form:)
Enter page name (no "." or "/"):
(:input text n:)(:input submit ok Edit:)
(:input hidden action edit:)
(:input hidden template Templates.MyTemplate:)
(:input end:)

This will open the page for editing. If you have defined a "template", the 
edit text area will be filled with the contents of the template page.

If the user enters "." or "/", the new page will be outside the current group 
(ie. Main.Test). It is much like the difference between [[Link]] or 
[[Main.Link]].

There is a recipe that can be usefull too:
http://www.pmwiki.org/wiki/Cookbook/NewPageBoxPlus

It's easier and you can define the Group (it will clear the dots and slashes a 
user entered).

Hope this helps,
Petko







More information about the pmwiki-users mailing list