[pmwiki-users] conditional markup and page text variables

Patrick R. Michaud pmichaud at pobox.com
Sat Feb 17 13:37:06 CST 2007


On Sat, Feb 17, 2007 at 12:24:12PM -0600, Jon Haupt wrote:
> On 2/17/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> >However, in this particular example, you'd be better off
> >writing the following (which does work):
> >
> >    (:if equal {*$:Blah} '1' :)
> >    Oatmeal
> >    (:if:)
> 
> Ah yeah, that would work for me, thanks.  I could see this coming to
> be a problem with pagelists, though, right?

No, it actually works fine in pagelists.  The problem isn't with
the use of the conditional itself, but rather that PmWiki currently
does only one pass of variable replacement prior to evaluating
the conditional.  So, in a normal page the conditionals see
only the result of the nested substitution but not the outer one.

In pagelists this isn't a problem, because the markup is passed multiple
times through the variable replacement prior to the conditionals
being processed.  (It might fail if there are three levels of nesting
in the pagelist template...  but I don't know anyone crazy enough to 
be doing that yet. :-)

Pm



More information about the pmwiki-users mailing list