[Pmwiki-users] About [:fi:] (Was: can i get a "live" sidebar?)

Knut Alboldt mailing
Sat Oct 16 08:32:45 CDT 2004


At 13:34 16.10.2004, Pm wrote:
>On Sat, Oct 16, 2004 at 11:35:36AM +0200, chr at home.se wrote:
> > On Fri, 15 Oct 2004, Patrick R. Michaud wrote:
> >
> > > The [:if ...:] syntax allows portions of the markup text
> > > to be conditionally processed (up to the next [:if:]) ...
> >
> > So a clause statement is not terminated by and end-of-line, but only by
> > the next [:if...:] (or end-of-page)?
>
>Right.

Oh, now I understand the additional [:if:] at the end of some lines in your 
first message (added this again to the docs)

> > And I think it'd also be more readable if something like '[:endif:]' could
> > be defined as a macro for '[:if:]'.
>
>You can use [:ifend:] (analogous to [:tableend:]).  But it'd be no problem
>to support [:endif:] as well, and they work exactly the same.

I think [:if:] would be enough, otherwise you really could think that 
nested if's are impelmented

> > However, if nested if-statements aren't allowed, I think we will quickly
> > run into problems with something like this:
> >       [:if group PmWiki:][:include Main.SideBarPmWiki:][:endif:]
> > when 'Main.SideParPmWiki' contains if-statements. Or am I missing
> > something here?
>
>[:if:]'s are processed entire before [:include:].  Thus in the above,
>the [:if group PmWiki:]...[:ifend:] gets completely processed before
>the [:include:] is processed, thus the result of the outer [:if:] is either
>the include itself if we're in the PmWiki group or a null string if we're not.
>Then, if Main.SideBarPmWiki contains any if-statements, those get processed
>after the include takes place and the outer if is already gone--i.e.,
>there's not any interaction between the outer and included ifs.

If I understand right: so if you use includes, a kind of nested [:if's:] is 
possible

Knut 




More information about the pmwiki-users mailing list