Categories > TinyButStrong general >

trying to understand conditionals

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: gmak
Date: 2004-02-18
Time: 13:08

trying to understand conditionals

OK...

I've got a block, which is a merged array, and I can display the values that I want with:
     [errs.msg;block=tr]

but I want to display something else if the array is empty. I've tried:
     [tbs_check;errs.msg;block=tr, ifempty='something here']

But I never seem to get the block displayed with the array even if it is NOT empty.

Where am I going wrong?
By: Pirjo Posio
Date: 2004-02-18
Time: 13:51

Re: trying to understand conditionals

Hello gmak!
Maybe looking at gavin's post a few lines below will help?
The title is "help with conditional blocks"
-Pirjo
By: gmak
Date: 2004-02-18
Time: 16:57

Re: trying to understand conditionals

Maybe I'm being really dumb, but I can't seem to get this to work.

in php I have:
$TBS->MergeBlock("errs",$theErrors);

I have tried:

[errs.msg;block=tr;ifempty='something else']
Which gives correct outup if [errs.msg] has values, but doesn't show correctly when [errs.msg] is empty

I have also tried (from gavin's post)
[tbs_check.errs; block=tr; if [errs.msg]!='']
buth this doesn't give me anything.

Excuse my stupidity, but I need some advice.

Thanks
By: peirgwnael
Date: 2004-02-20
Time: 21:44

Re: trying to understand conditionals

Isn't it because you pass not an array with msg ?
Personnaly, I use the tag friend to hide the error block when the array wich store the error is empty. 
<tr>
<td>[error.key]</td>
<td>[error.val;block=tr;htmlconv=no;friend=div]</td>
</tr>