Categories > TinyButStrong general >

Problem with "IF" and "blk"

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Sergo
Date: 2009-05-21
Time: 15:23

Problem with "IF" and "blk"

Hello

look at this code:

///   PHP code
$status="TEST;
$TBS = new clsTinyButStrong ;
$TBS->LoadTemplate('index.htm');
$TBS->MergeBlock('blk1',$connect_id,"SELECT id,status FROM test");


<--html code -->
<center>[var.status]</center>
<tr>
   <td>
       TEST ID = [blk1.id;block=tr]
       <my_rule>
            MY RULE IS OK
            [onload_1;block=my_html;when [blk1.status] == 0]
        </my_rule>
    </td>
</td>

it is don't see variable [blk1.status]
it is working only whith [var.status] but i need [blk1.status]
help
By: Skrol29
Date: 2009-05-22
Time: 00:12

Re: Problem with "IF" and "blk"

Hi Sergo,

Of course. [onload_1] is merged before that [blk1.status] can be merged. Thus the "when" condition is always false. Try to use [onshow] instead of [onload] and it should work as you expect.