Thank for your suggestions and help.The variable $title is calculated from the contents processed within the ChordPro markup, and I want to make the value held in $title available in for use outside the ChordPro markup, eg in pagelists etc. I have added the global declaration to my function. (in front of the lines shown in my example). I'm still not seeing a page variable. Do I have to tell PmWiki to 'update and save' the page? thanks again
Simon 2009/9/27 Peter Bowers <pbow...@pobox.com> > On Sat, Sep 26, 2009 at 10:24 AM, Simon <nzsk...@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 >
_______________________________________________ pmwiki-devel mailing list pmwiki-devel@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-devel