Categories > TinyButStrong general >

Using a block twice?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: tcwatts
Date: 2005-07-28
Time: 06:11

Using a block twice?

Hi,

Why can't I do this? (ex. from a mySQL recordset)

<li>[row.categories;block=li]<li>

<h2>[row.categories;block=h2]</h2>

The first LI is a list of categories, then I want them at the bottom as headers. Does this mean I have to retrieve from DB twice?

Thanks.
By: Skrol29
Date: 2005-07-28
Time: 09:51

Re: Using a block twice?

Hi,

You have to use 2 blocks, but TBS can merge them both in one shot. I mean only one query call.

HTML:
<li>[row1.categories;block=li]<li>
<h2>[row2.categories;block=h2]</h2>

PHP:
$TBS->MergeBlock('row1,row2',$mycon,'SELECT categories FROM....');
By: tcwatts
Date: 2005-07-28
Time: 10:59

Re: Using a block twice?

Yes, of course! Thanks again, that's why I keep using TBS, great support!