[pmwiki-devel] Creating a page text variable in a recipe
Peter Bowers
pbowers at pobox.com
Sun Sep 27 14:44:49 CDT 2009
On Sun, Sep 27, 2009 at 8:06 PM, Simon <nzskiwi at gmail.com> wrote:
...
> global $FmtPV;
> $FmtPV['$SongTitle'] = $songtitle;
Note that as DaveG mentioned earlier, $FmtPV must result in correct
PHP syntax. Thus the quotes are necesssary, not optional:
> $FmtPV['$SongTitle'] = "'".$songtitle."'";
(That is double-quote single-quote double-quote both prepended and
appended to your string.)
> However when I use {$SongTitle} on the page (or in a pagelist) I don't see a
> value being returned (ie displayed).
> Your options 1 and 3 seem to indicate where I need to investigate further.
You do not need any other options to see {$SongTitle} on the current
page -- with what you have above you should be able to see the
variable (assuming quotes are corrected and assuming the order of the
rules is appropriate.) I recommend getting your recipe to the point
where you can see this {$SongTitle} on the current page before
exploring other options related to caching the value or changing the
text or whatever...
(This probably goes without saying, but make sure you have a line in
your source on that page that says "The value of SongTitle is
{$SongTitle}" or something like that.)
-Peter
More information about the pmwiki-devel
mailing list