[Pmwiki-users] Question: How do I create my own $PageUrl

Patrick R. Michaud pmichaud
Tue Jul 20 09:40:22 CDT 2004


On Tue, Jul 20, 2004 at 08:41:31PM -0700, Steven Leite wrote:
> Suppose I want to form my own $PageUrl base on two variables
> [...]
> My first attempt was 
> 
> $PageUrl = FmtPageName($PageUrl, "$MyGroup.$MyPage");
> 
> But that didn't work. 
> Thanks for any suggestions.

It'll work if you define global variables $MyGroup and $MyPage that
have the values you want.  However, you have to be a bit careful
here, because if these variables are frequently changing value (e.g.,
in a loop of some sort), you'll also want to set $GCount=0; to get
FmtPageName to reset its cache of variables that it uses to speed
things up.  And resetting the cache is a bit of an expensive operation.

In PmWiki 2.0 you can get things into FmtPageName (w/o worrying about
the cache) by doing  $FmtV['MyGroup'] = ...

Pm



More information about the pmwiki-users mailing list