Categories > TinyButStrong general >

Display First Record Before Merge Block

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Anthony
Date: 2015-04-30
Time: 17:45

Display First Record Before Merge Block

Is there a way to display a record from a block syntax in the html template before the actual block syntax appears? I want to display a value from a field in the first record retrieved from DB before the actual records are outputted in the block syntax. For example:

<p>[blk.val]</p>
<div>[blk.val; block=div]
.....
</div>
By: Skrol29
Date: 2015-05-01
Time: 23:15

Re: Display First Record Before Merge Block

This may work, try it :

<p>[blk1.val]</p>
<div>[blk2.val; block=div]
.....
</div>

$TBS->MergBlock('blk1,blk2', $my_connexion, $sql);

It can work because 'blk1,blk2' merges the 2 blokcs with the same data, and block 'blk1' has no block definition so it will merge only the first record.
By: Anthony
Date: 2015-05-04
Time: 20:02

Re: Display First Record Before Merge Block

Thanks! That worked.