Sorry about the newbie-ish question. I just recently started using TBS, but after going through the manual, I am having a hard time finding out how to do something relatively should be simple.
I want to show a certain text if only a certain value is set.
The php equivalent to what I would want would be this.
<?php
$somevar = $_POST['somevariable'];
if($somevar == 'yes'){
echo 'This is something I am showing to only if one variable is set.'
}
if($somevar == 'no'){
echo 'This is a different variable.';
}
if($somevar == 'maybe'){
echo 'This is another variable set.';
}
?>
|
I have gotten this to successfully work:
<table>
<tr>
<td>
This is something I am showing to only if one variable is set.[onshow_1;block=tr;when [var.$somevar]=yes]
</td>
</tr>
<tr>
<td>
This is a different variable.[onshow_1;block=tr;when [var.$somevar]=no]
</td>
</tr>
<tr>
<td>
This is another variable set.[onshow_1;block=tr;when [var.$somevar]=maybe]
</td>
</tr>
</table>
|
Unfortunately, this is not what I'm aiming to do. It FUNCTIONS how I want, sort of, but I'm wondering if there is something similar to this (I know the next part is psuedo-code, sorry about that)
[onshow;somevar1=yes]This is some text.[end;somevar1=yes] [onshow;somevar1=no]This is another text.[end;somevar1=no] [onshow;somevar1=maybe]This is another text.[end;somevar1=maybe]
|
or even something similar to this would be nice too if there is a way.
<?php
$yes = null;
$no = null;
$maybe = true;
?>
[onshow;yes] this is some text[end;yes] [onshow;no] more text[end;no] [onshow;maybe] and another bunch of text[end;maybe]
|
The idea behind this is that I could use the sets of variables to turn certain parts of texts on or off depending if a variable is set to a certain value, or even if it is set at all without relying on tr tags, or blocks of any sort. I know the last few parts are psuedocode and are not true TBS code, but I was wondering if there is anything similar to it. I'm sorry if this has been answered before, but I hadn't been able to find any information about it.