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

chr@home.se chr
Sat Oct 16 06:50:14 CDT 2004


On Sat, 16 Oct 2004, Patrick R. Michaud wrote:

> Because I didn't want to deal with [:else:] and [:elseif:] -- that
> requires that I keep track of the status of the previous condition,
> or start doing even larger searches/replacements.

Ok, I see. (although I predict you'll get this request from other user's
soon after it starts being used :)

> > 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:]).

I didn't know [:ifend:] was available, that works fine for me.

> > 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.

Ok, I see.

> 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.
> 
> (Boy that looks confusing to describe, but I think it actually does
> what one would hope it would do.)

I think I got it, so I'm happy :)

/Christian

-- 
Christian Ridderstr?m, +46-8-768 39 44               http://www.md.kth.se/~chr





More information about the pmwiki-users mailing list