Categories > TinyButStrong general >

[Question] Conditional display and table cells

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Leo
Date: 2007-04-19
Time: 04:56

[Question] Conditional display and table cells

I want remove one or two cells (it means, a column
of vertical cells from a "mergeblock") when the data
is empty.

I´m confused with the conditional parameters. Nothing
I've tried has worked.

Does anybody have the example of it?
(Some kind of "bmagnet" for table columns...)

Thanks
By: Skrol29
Date: 2007-04-19
Time: 11:52

Re: [Question] Conditional display and table cells

Can you give an example of what you need in normal and what you need when thr is no data ?
By: TomH
Date: 2007-04-19
Time: 11:57

Re: [Question] Conditional display and table cells

Hello Leo,

If you have specific code you want to get working... please realize that those wishing to help cannot "see" what you are seeing. Without seeing actual code everyone is only guessing so it can be very frustrating for those helping which means difficult to get good help/answers.

To get useful help post the following...
* the actual php, NOT psuedo-code, show copied code from your case
* the actual html template code
* var_dump or print_r  of the query result or data array

Let's see what you've got... someone's always here to help.
By: Leo
Date: 2007-04-19
Time: 17:45

Re: [Question] Conditional display and table cells

Sorry...

The PHP code itself just retrieve data from array/database
and populates a html table. One cell receive data but it's only
visible when a specific data from other cell is found.

The HTML code looks like this (reduced):
<table>
    <tr>
        <td>[stats.total;block=tr]</td>
        <td>[stats.ip]</td>
        <td>[stats.time]</td>
        <td>[stats.referer]</td>
        <td>[stats.isrefspam]</td> (If this cell receive a specific data...)
        <td>[stats.ext]</td>
        <td>[stats.count]</td> (...this cell become invisible...)
    <td>...</td>
    </tr>
    <tr>
        <td>[stats.total]</td>
        <td>[stats.ip]</td>
        <td>[stats.time]</td>
        <td>[stats.referer]</td>
        <td>[stats.isrefspam]</td>
        <td>[stats.ext]</td>
        <td>[stats.count]</td> (...and so on...)
    <td>...</td>
    </tr>
    <tr>
    ...
    </tr>
</table>

I've tried that: [stats.count;block=td;when [stats.isrefspam]='data']
but don't worked. (maybe because the block parameter misuse.
I don't know)

Note: I was informed this morning that the project
will be migrated from TBS to Smarty.

Thanks anyway.
By: Skrol29
Date: 2007-04-19
Time: 23:47

Re: [Question] Conditional display and table cells

So I guess you don"t need help on his.

Simply deleting the <td></td> cell is the more simple solution but not the good way because it is not HTML valid.
When you say "this cell become invisible", what to you intend to have in HTML ?
By: Leo
Date: 2007-04-20
Time: 04:44

Re: [Question] Conditional display and table cells

No. But thanks.

I made it happen this evening using a third
variable and magnet (kinda lazy solution
but it luckly helped with the colspan).

Since they (AKA "the bastards") out of the blue
changed the project´s template system I´m not
worry about it anymore.

I will still use TBS in my personal projects.

Thanks again.