[pmwiki-users] how to get pmwiki to use markups in a string

Hans design5 at softflow.co.uk
Mon Aug 31 10:31:10 CDT 2009


Monday, August 31, 2009, 3:44:28 PM, Patrick Ogay Evolution wrote:

> $SkinCopyright = 'made and hosted by [[http://o-s.ch|OS-Services]] ©
> VHC, Inc. — All Rights Reserved 2009';

try a custom Page Variable:

in config:

$SkinCopyright = "made and hosted by [[http://o-s.ch|OS-Services]] © VHC, Inc. — All Rights Reserved 2009";

$FmtPV['$SkinCopyright'] = '$GLOBALS["SkinCopyright"]';


in a wiki page {$SkinCopyRight}

Same should work in a skin template as well.

Note the use of various ' and " !!


If you have more complicated stuff, you can call a custom function
in  your FmtPV declaration, like:

$FmtPV['$SkinCopyright'] = 'MakeSkinCopyright($pn)';
function MakeSkinCopyright($pn) {

  $out = ....do things here....

return $out;
}

you could also pass other arguments to the function.
$pn is a placeholder for the page name, which will be evaluated when
$FmtPV gets processed.

If it is really necessary, you could call MarkupToHTML() from within
your function, but more often it is not.
Call FmtPageName() in side the function to resolve any variables.
If it is just language translations from an XL page, you can use the
XL()function inside you custom function, for instance:

 $out = XL("made and hosted by");
 $out .= " [[http://o-s.ch|OS-Services]]";
 $out .= XL("© VHC, Inc. — All Rights Reserved 2009");
 return $out;


  ~Hans




More information about the pmwiki-users mailing list