[email protected] writes:
According to the documentation you can refer to a different page's page
variable using the syntax {pagename$variable}.

I'm defining some new page variables from $GLOBAL['whatever'] inside of my
config.php, but they evaluate only for the current page, I can do the
{pagename$variable} syntax to pull in from other pages.  Is there a way to
make that work?  Maybe a sample FmtPV I could look at that simply pull
something in somehow... I figure with a good example, I can figure it out
from there.

Here is an example:

 $FmtPV['$YourVariable'] = 'YourFunction("$group.$name", $page["title"])';
 function YourFunction($pagename, $targetpagetitle) {
   global $Whatever;

   # do something with $pagename
   $uppercase = strtoupper($pagename);

   # or, instead of RetrieveAuthPage(), just use PageVar()
   $mytitle = PageVar($pagename, '$Title');
   $myvalue = PageVar($pagename, '$:MyTextVar');

   # return something
   return $Whatever . $myvalue;

 }

The "$group.$name" part will be supplied automatically according to the target page, so {$Var} will refer to the current page, {OtherPage$Var} will refer to the other page ("$group.$name" will be passed as "Group.OtherPage").

If you have the patience, you can read the definitions of the default page variables in pmwiki.php, lines 121-151 approximately.

Petko


_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to