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

Simon nzskiwi at gmail.com
Sat Sep 26 21:23:49 CDT 2009


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 <pbowers at pobox.com>

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.pmichaud.com/pipermail/pmwiki-devel/attachments/20090927/4e9490ca/attachment.html 


More information about the pmwiki-devel mailing list