Environment: PHP 5.3.5 MySQL Server 5.5.8
Was Using TBS 3.7.0 Now Using TBS 3.8.2
In the sql dataset that I merged to TBS (TinyButStrong) I have a sender / recipient info. I want to display the one that is currently not user. I am having trouble getting the TBS IF THEN statements working.
IN php
$user_id = getUserId(); // returns user id
...
$TBS->MergeBlock('activity',$sql_data);
IN html, the first name is not being populated, while the last name is cause I am just directly requesting the value, even though it maybe the incorrect value.
<li>
<div id="name">
<a href="">
[
if [activity.sender_id]!=[var.user_id];
then[activity.sender_firstname];
else[activity.recipient_firstname];
block=li;headergrp=message_id;ope=max:12
]
[activity.sender_lastname;block=li;headergrp=message_id;ope=max:12]
</a>
</div>
</li>
I have been searching and reading the TBS manual but the examples of using if / else with blocks are not like this.
Could someone please help show me what it is I am doing incorrectly?
Currently my output looks like this:
[if1!=2;then Joe;else Jane;block=li;headergrp=message_id;ope=max:12] Doe
When I just want the output to be Jane.
You can use parameter "if" alone in order to hide the value when the condition is not true.
There is also a solution with conditional sections, but they don't work with parameter "headergrp".