[pmwiki-devel] Creating a page text variable in a recipe

Peter Bowers pbowers at pobox.com
Sat Sep 26 11:52:36 CDT 2009


On Sat, Sep 26, 2009 at 10:24 AM, Simon <nzskiwi at gmail.com> wrote:
> I have set up some page variables
>   $FmtPV['$ChordProVersion'] = $RecipeInfo['ChordPro']['Version'];
>   $FmtPV['$SongTitle'] = $title;
> I did this in the function (Chord_Parse) that is called by the Markup
> function.
> The variables don't show up on the page, do I need to make something global?

Although there may be reason to do this assignment to $FmtPV within a
function called by markup ... it would be fairly complicated and you
would have to carefully judge the order of rules and when the PV was
going to be used and etc.  (And by all means $FmtPV would have to be
declared global in your function.)

Typically, however, you would initialize $FmtPV outside of any
function so that its value is available from then on.

This is in addition to the necessary changes suggested by DaveG.

-Peter



More information about the pmwiki-devel mailing list