[pmwiki-users] "Add Page" Recipe?

Nils Knappmeier nk at knappi.org
Thu Mar 10 16:52:19 CST 2005


David Spitzley wrote:

>This looks like a promising solution, but I don't know into which file I
>should insert the Markup statement.  I've added it to my
>local/config.php file, but when I enter (:createpage:) into a page, it
>just displays (:createpage:) rather than the form.
>  
>
Mhm, sorry about that. I thought it was that easy, so I didn't test it. 
Obviously, I made some mistakes...
Try the following, at the top of you local/config.php:

---------------<snip>---------------------------------
if ($_GET['createfrom']!="") {
    $pagename=MakePageName($_GET['createfrom'],$pagename);
}
$CreatePageForm='<form action="'.$ScriptUrl.'">
   <input type="text" name="n" value="NameOfThePage" />
   <input type="hidden" name="action" value="edit" />
   <input type="hidden" name="createfrom" value="'.$pagename.'" />
   <input type="submit" name="submit" value="Create" />
</form>';
Markup('createpage','directives','/\(\:createpage\:\)/e',
       "Keep('$CreatePageForm')");
--------------</snip>--------------------------------
This time, I tested it. ;-)

Nils




More information about the pmwiki-users mailing list