Categories > TinyButStrong general >

Serial display

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: tobi
Date: 2006-10-29
Time: 17:00

Serial display

I use this feature for an overview of pictures:
http://tinybutstrong.com/manual.php#html_block_serial

but i do not need different content in the fields, because the database provides the different data.

can i use subtemplates for this? is there a possibily for raising the number _1 _2...

that could help me also in my other treat: "use multible templates with multible loadtemplate()?"
By: Skrol29
Date: 2006-10-30
Time: 18:08

Re: Serial display

> can i use subtemplates for this? is there a possibily for
> raising the number _1 _2...

Yes, see MergeBlock() with keywork 'num'.
Example: $TBS->MergBlock('bz','num',6);
By: tobi
Date: 2006-10-31
Time: 22:05

Re: Serial display

hm, am sorry, but i dont understand it completely

I call the function like this:

$sql = 'SELECT * FROM ...';
$TBS->MergeBlock('il',$auth->mysql->dbconn, $sql);

Do i have to write a second line with NUM and the number of repeats?

By: Skrol29
Date: 2006-10-31
Time: 23:31

Re: Serial display

> Do i have to write a second line with NUM and the number of repeats?

Yes.
But can you give an example of what you're trying to do ?
By: tobi
Date: 2006-11-01
Time: 10:59

Re: Serial display

okay, i have a dbtable with a list of pictures and i want to display the pics in 5 columns

so i start with a mysql query and the TBS Merge:

$sql = 'SELECT id, name, extension FROM ...';
$TBS->MergeBlock('il',$auth->mysql->dbconn, $sql);

I use this kind of template:
.....
<table>
<tr>[bx;block=tr;serial]
<td>[bx_1.id;block=td]
......
</td>
<td>[bx_2.id;block=td]
......
</td>
<td>[bx_3.id;block=td]
......
</td>
.............
</tr>
</table>

The content in the single td blocks is always the same and means for me 15 lines of code

to display 8 columns i have to copy and paste 8 times and change the numbers. and if only one letter changes, i have to change all or do copy and paste serveral times
By: sheepy
Date: 2006-11-02
Time: 10:55

Re: Serial display

I don't know if there's a better way but I will merge the internal block first (to clone them), then merge the data.

<table>
<tr>[bx;block=tr;serial]
<td>[bx_[a.val;block=td].id;block=td]
......
</td>
</tr>
</table>
$TBS->MergeBlock('a','num','8');
$TBS->MergeBlock('bx',$conn,$sql);

At least I don't have to copy the block...
By: tobi
Date: 2006-11-02
Time: 14:23

Re: Serial display

thanks a lot!!!

it works great! its really tiny but strong!