<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#ffffff">
I'm having a bit of trouble trying to add a Page Variable via my
script. <br>
<br>
Reference: <a
href="http://www.pmwiki.org/wiki/PmWiki/PageVariables">http://www.pmwiki.org/wiki/PmWiki/PageVariables</a><br>
<br>
Here's my hook (for testing purposes):<br>
<br>
<b><font color="#009900"><tt>Markup("MyFunction)", "<directives",
"/\\(:setpv (.*?):\)/e", 'my_function("$1");');</tt></font></b><br>
<br>
So, if I were to type:<b><tt> <font color="#009900"> (:setpv
price="$39.99":)</font></tt></b> on a page, I should be able
to referencing {$price} when I need to. <br>
<br>
For example: <b><font color="#009900"><tt>The price you entered
was {$price}.</tt></font></b><br>
<br>
Unfortunately that doesn't seem to be working...<br>
<br>
Here's a sample function:<br>
<br>
<b><font color="#009900"><tt>my_function($args) <br>
{<br>
<br>
$my_vars = ParseArgs($args);<br>
<br>
if (isset($my_vars['price'])) <br>
</tt></font></b>
<blockquote><b><font color="#009900"><tt>{</tt><br>
<tt> // set page variable for 'price'</tt><br>
<tt> $price = $my_vars['price'];</tt><br>
<tt> $FmtPV['$price'] = "$price";</tt><br>
<tt>}</tt><br>
</font></b></blockquote>
<b><font color="#009900"><tt>return;<br>
}</tt></font></b><br>
<br>
<br>
That should have set the Page Variable {$price} which should be
accessible on any page, <br>
however, when I edit the page and place {$price} on it, nothing
shows up.<br>
<br>
<br>
<br>
<br>
</body>
</html>