[pmwiki-users] conditional markup 'else' issue

Petko Yotov 5ko at free.fr
Sun Jun 10 06:43:25 CDT 2007


On Sunday 10 June 2007, info at hassanein.ch wrote:
> There is no :else markup therefore I used the not operator but it does
> not work in conjunction with the && operator.
>
> Any idea how I can achieve that?
>
...
> (:if !author user1 && !author user2 :)
> text for all other users, but not for user1 and user2
> (:ifend:)

The beta version has (:elseif ...:) and (:else:) markups, which is a great 
simplification (however, no nested ifs). But here is how we did it before:

   (:if [ ! author user1 && ! author user2 ] :)
   Note the spaces around ! and [ ]

Also note that any (:if:) automatically closes any previous if, so you can 
just have:

   (:if author user1:) Stuff for user1
   (:if author user2:) Stuff for user2
   (:if [ ! author user1 && ! author user2 ] :) Hi all!
   (:if:)

Thanks,
Petko




More information about the pmwiki-users mailing list