Categories > TinyButStrong general >

table with if then

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Peter
Date: 2003-10-08
Time: 17:51

table with if then

I have tried many version but i find not the right answer to this problem :(

i show this problem here in php code:
if (!$calendar==0)
{
echo "$calendar with tables around it";
}
#else do nothing

<table width="100%" border="0" cellspacing="1">
<tr>
<TD height="22" bgcolor="#000000">
<div class=bereich>date:</div>
</TD>
</tr>
<tr>
<td bgcolor="#FFFFFF">[calendar;htmlconv=no] [tbs_check.1;block=table;if[var.calendar]=0]</td>
</tr>
</table>  

i hope somebody understand what i mean :)

Bye Peter
By: Skrol29
Date: 2003-10-08
Time: 18:10

Re: table with if then

Hi Peter,

You template should work if you add a space between the "if" and the "[".

Ther is another way to do the same wich is a bit smarter.
Template you merge the calendar html source , and at the end, you check the condition to keep or delete the table. But you can perfore the check before and then merge the calendare if the table is still ther.

PHP:
if ($calendar==0) {
  $cal_src = '' ;
} else {
  $cal_src = '<table>...</table>' ;
}

HTML:
<table width="100%" border="0" cellspacing="1">
<tr>
<TD height="22" bgcolor="#000000">
<div class=bereich>date:</div>
</TD>
</tr>
<tr>
<td bgcolor="#FFFFFF">[var.cal_src;friend=table;htmlconv=no]</td>
</tr>
</table> 

Enjoy,
By: Peter
Date: 2003-10-09
Time: 12:48

Re: table with if then

ah i don`t thought of "friend"  :)