[pmwiki-users] Page Variables help - how to take one and split into two

stevecrisp at gmail.com stevecrisp at gmail.com
Sun Nov 1 17:08:07 CST 2009


2009/11/1 Hans <design5 at softflow.co.uk>

>  if you need the PVs as you say, for db fields,
>
> and want to use a single coord markup,
>
> you could try this to set both properties:
>
Thanks for that Hans.  I added the following based on your example to get it
to parse (moved last quote closing PZZ line, added semi-colons and used
$lat, $long variables to SetProperties - right?)

Markup('coord', 'directives',
  "/\\(:coord\\s+(.*?)\\s+(.*?)\\s*:\\)/ei",
  "PZZ(SetCoord(\$pagename, PSS('$1'), PSS('$2')))");

function SetCoord($pagename, $lat, $long) {
    SetProperty($pagename, 'latitude', $lat, ', ');
    SetProperty($pagename, 'longitude', $long, ', ');
}

I've printed the parameters passed to SetCoord() and they are as I expect.

How can I see or access the values set by SetProperty().  I've run
?action=diag and searched for latitude and printing {$:latitude},
{$Latitude} within the wiki page which has the (:coord:) directive.

Perhaps I need to add :

$FmtPV['$Latitude'] = ...
$FmtPV['$Longitude'] = ...

...lines within this function also?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20091101/b5bcfcf7/attachment.html 


More information about the pmwiki-users mailing list