Thanks very much Hans and Peter.<div>I'll work in these solutions as soon as I can.</div><div><br></div><div>Is there a way I can test and only do this if the page is being saved (rather than browsed, previewed, etc)</div>
<div><br></div><div>Simon</div><div><br></div><div><br><br><div class="gmail_quote">2009/9/28 Hans <span dir="ltr"><<a href="mailto:design5@softflow.co.uk">design5@softflow.co.uk</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">Sunday, September 27, 2009, 7:10:57 PM, Simon wrote:<br>
<br>
> I want a variable associated with a particular wiki page<br>
> (cf {PageName$PageVariable} or {PageName$:PageTextVariable}<br>
<br>
> that is set by the recipe and saved as part of the page contents.<br>
<br>
</div>in your function you need something like this:<br>
//first get the page text content<br>
$page = RetrieveAuthPage($pagename, 'edit', true);<br>
if (!$page) Abort("?cannot edit $pagename");<br>
$newpage = $page;<br>
$text = $page['text'];<br>
<br>
//do something to $text<br>
//$key is name of PTV, $val is PTV value<br>
//adding a PTV:<br>
$text .= "\n(:$key: $val:)";<br>
<br>
//saving the page with the modified $text<br>
$newpage['text'] = $text;<br>
UpdatePage($pagename, $page, $newpage);<br>
<br>
//back to view the page<br>
//redirect is good since we updated or added a PTV<br>
//and want to see the change immidiately<br>
Redirect($pagename);<br>
//end of function<br>
<br>
//or alternatively<br>
// HandleDispatch($pagename,'browse');<br>
// exit;<br>
//end of function<br>
<font color="#888888"><br>
Hans<br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>____<br><a href="http://kiwiwiki.co.nz">http://kiwiwiki.co.nz</a><br>
</div>