[pmwiki-users] Upgrade woes: PublishPDF and PmWiki 2.1beta25

Patrick R. Michaud pmichaud at pobox.com
Tue Feb 14 16:16:10 CST 2006


On Wed, Feb 15, 2006 at 10:59:21AM +1300, John Rankin wrote:
> >To avoid possible confusion I didn't mean "{$PageVar}" literally--
> >sorry if it came across that way.  I meant that {$...} is the new 
> >page variable syntax,used both in markup and in strings passed to 
> >FmtPageName(), and it causes values to be taken from the $FmtPV
> >array.
> 
> So I *should* be adding {...} around default variables? Um, it seems
> to work without them, and to maintain compatibility with 2.0, I'd
> rather not add them at this stage.

Page variables in FmtPageName() continue to work without the
braces because I want to preserve compatibility with 2.0 scripts.  :-)
It's perfectly okay for recipes to continue to leave the braces out
for the foreseeable future if 2.0 compatibility is desired.  But
new recipes and scripts targeting current and future versions of
PmWiki ought to use the braces.

Note also that global PHP variable substitutions and substitutions
from the $FmtV array are always specified *without* the braces.  
In summary:

   "page variables" tend to be associated with specific pages and
       things that appear in markup, such as {$Title}, {$Group}, 
       {$Name}, {$PageUrl}, etc.

   "global variables" tend to be associated with the PHP script
       and $FmtV array, such as $GroupHeaderFmt, $FarmD, 
       $AuthorLink, etc.
      
> >As far as $FmtP being substantially changed, looking into the future
> >I think I can safely claim that it won't be changing in 2.1, or anytime
> >in 2006.
> 
> And for backwards compatibility, I can continue to use FmtPageName
> rather than the new PageVar function?

Absolutely -- they do different things.  FmtPageName still
does formatting of strings, while PageVar is designed to return
the value of a single page variable.  In fact, FmtPageName
calls PageVar in order to do the page variable substitutions.

> I'm very happy that PmWiki now uses { ... } consistently --
> the presence or absence of { ... } has often caught me out.

Yes, I just wish I had thought of it much sooner... :-)

> Let me send you (separately) the wikistyles.php from beta 25,
> modified along the lines we reached in the earlier discussion.
> I need to carry out a few more tests on it, but I think it's 
> working correctly.

Okay, sounds great.

Pm




More information about the pmwiki-users mailing list