Categories > TinyButStrong general >

2dimensional table

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: thomas
Date: 2003-12-13
Time: 19:37

2dimensional table

Hi!

I'm triing to build gallery site where you can select a thumbnail from a kind of matrix (2 dimensional table) that should look like this:
<tr><td><img></td><td><img></td></tr>
<tr><td><img></td><td><img></td></tr>
the sources of the imgage-elements are saved in a file (as i do not have access to a mysql database). Width and height of the table are variable and unknown to the template file...
I thought i could implement it with clone-blocks but the example in the documentation was only for sql queries. So my question is: how can i do this when i have the data stored in a simple 2dimensional php array?

Before i forget it: i like to thank the developers of tbs, you did a really great work!

(sry for bad english...)
ciao!
By: Skrol29
Date: 2003-12-15
Time: 12:11

Re: 2dimensional table

Hello Thomas,

TBS supports PHP Arrays as a data source, but the array must have a certain structure.
If you don't want to change the structure of you Array, you can also create you own 'data source type' for TBS. For that, you will have to create 3 function for reading the array. This is described at the 'custom data source' sub-chapter in the MergeBlock() chapter in the manual.

By: thomas
Date: 2003-12-17
Time: 18:52

Re: 2dimensional table

thanx skrol
That could be a good solution but i also found another (yet less elegant) solution. i simply add a "linebreak" variable to each of my array elements and let tbs output the "</tr><tr>" tags through the conditional display feature. like that
[img.lb;if [val]=1;then '</tr><tr>'; else '';htmlconv=no]