Categories > TinyButStrong general >

If then Else

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: IndridCold
Date: 2006-12-05
Time: 09:14

If then Else

Hi,

with TBS syntax how would you accomplish this

if($condition==true)
{
?>
  HTML HERE
<?
}
else
{
?>
  OTHER HTML HERE
<?
}
?>


Ideally im looking for something similar to smarty's foreachelse syntax.

any ideas?
By: Skrol29
Date: 2006-12-05
Time: 10:20

Re: If then Else

Hi,

This is the simple conditional display feature:
<div>[onload_cond1;block=div;when [var.x]=1] HTML HERE </div>
<div>[onload_cond1;block=div;when [var.x]=2] HTML HERE </div>
<div>[onload_cond1;block=div;when [var.x]=3] HTML HERE </div>
<div>[onload_cond1;block=div;default] HTML HERE </div>
In this example, I use <div> to bound the blocks but you can use what you want, even begin/end tags to delimit explicitly the bounds.