Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

inside an

It's not totally necessary for me, I can work around it the hard way, but is it possible?

I tried it myself. Something along the lines of...
<<if $isfemale is 1>>Hello there, lady. <<if $issick is 1>>You look ill!<<endif>> What's up?<<endif>>

Of course the above wouldn't work, but is there a way to make it work?

Comments

  • Your example does work.  :)  Because that is the way you do nested IF's

    <<set $isfemale = 0; $issick = 0>>

    <<if $isfemale is 1>>Hello there, lady. <<if $issick is 1>>You look ill!<<endif>> What's up?<<endif>>
    Shows nothing because both variables are zero,

    <<set $isfemale = 1; $issick = 0>>

    <<if $isfemale is 1>>Hello there, lady. <<if $issick is 1>>You look ill!<<endif>> What's up?<<endif>>
    Shows "Hello there, lady. What's up?" but NOT the "You look ill!" part because the second variable is zero

    <<set $isfemale = 1; $issick = 1>>

    <<if $isfemale is 1>>Hello there, lady. <<if $issick is 1>>You look ill!<<endif>> What's up?<<endif>>
    Shows "Hello there, lady. You look ill! What's up?" because both variables are ones
  • In addition to what greyelf said, note that there are also elesif's.
    <<if $isfemale is 1>>
    Hi, lady!
    <<elseif $isfemale is 0>>
    Hi, dude!
    <<else>>
    Howdy!
    <<endif>>
Sign In or Register to comment.