I'm having a bit of trouble trying to add a Page Variable via my script.

Reference: http://www.pmwiki.org/wiki/PmWiki/PageVariables

Here's my hook (for testing purposes):

*Markup("MyFunction)", "<directives", "/\\(:setpv (.*?):\)/e", 'my_function("$1");');*

So, if I were to type:*(:setpv price="$39.99":)* on a page, I should be able to referencing {$price} when I need to.

For example: *The price you entered was {$price}.*

Unfortunately that doesn't seem to be working...

Here's a sample function:

*my_function($args)
{

$my_vars = ParseArgs($args);

if (isset($my_vars['price']))
*

   *{
      // set page variable for 'price'
      $price = $my_vars['price'];
      $FmtPV['$price'] = "$price";
   }
   *

*return;
}*


That should have set the Page Variable {$price} which should be accessible on any page,
however, when I edit the page and place {$price} on it, nothing shows up.




_______________________________________________
pmwiki-devel mailing list
pmwiki-devel@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

Reply via email to