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

Hans design5 at softflow.co.uk
Mon Nov 2 15:30:23 CST 2009

try this:

$FmtPV['$Latitude'] = '@$page["latitude"]';
SaveProperties[] = 'latitude';
FmtPV['$Longitude'] = '@$page["longitude"]';
SaveProperties[] = 'longitude';

Markup('coord', 'directives',
   "PZZ(SetCoord(\$pagename, PSS('$1'), PSS('$2')))");

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

This could be improved to allow parameters like
lat=57.5 lon=-130
within the coord markup, by using the ParseArgs() function.


More information about the pmwiki-users mailing list