[pmwiki-users] Conditional Extensions
Martin Fick
fick at fgm.com
Thu Sep 15 17:12:59 CDT 2005
On Fri, Sep 16, 2005 at 12:05:15AM +0200, Dominique Faure wrote:
> At Thursday, September 15, 2005 11:53 PM [GMT+1=CET], Martin Fick wrote:
>
> >On Thu, Sep 15, 2005 at 11:44:08PM +0200, Dominique Faure wrote:
> >>>Also any thoughts on ways to nest conditions?
> >>>
> >>
> >>You should have a try on the Cookbook/ConditionalExtensions recipe which
> >>implements complex boolean expressions.
> >>
> >>if A then
> >> if B then
> >> something
> >> else
> >> something else
> >> endif
> >>endif
> >>is equivalent to:
> >>
> >>if A and B then
> >> something
> >>elseif A and not B then
> >> something else
> >>endif
> >>
> >
> >Yes, I have looked at (and I am using) that recipe. I did
> >not know that it could do that, what is the pmwiki syntax
> >for such an expression (there is no mention of such a
> >capability in the recipe)?
> >
> >
>
> [From PmWiki/ConditionalMarkup]
> ...
> Any (:if:) automatically terminates the previous one, thus markup can be
> easily cased:
>
> (:if auth read:)* You can read
> (:if auth edit:)* You can edit
> (:if auth upload:)* You can upload
> (:ifend:)
>
> So, you just have to "mix" it with Cookbook/ConditionalExtensions.
Oh, I get it, you are suggesting to not actually have
nesting but to instead use ANDs all over the place. Funny
that I didn't pick that up since that it was I am actually
doing. But I was hoping for a true nesting capability,
that can get rather ugly and very hard to read.
-Martin
More information about the pmwiki-users
mailing list