Categories > TinyButStrong general >

limit result of block

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: tjitte
Date: 2006-02-16
Time: 21:34

limit result of block


Hi Skrol29,

First of all, thanks Skrol29 for all your help so far… Your template engine is great!!

I got a question I like to limit the result of a block element.
So far it should be a big deal.

But I like to do this:

[articles;block=div;limit=3]
<div>
<h3>[articles.title]</h3>
<p>[articles.desciption]</p>
<div>

Can I ? :)

PHP I currently use:
$RecCnt = $Temp->MergeBlock('article',$articles,'',$PageSize,$pn,$RecCnt) ;
$Temp->MergeBlock('message','array', 'articles[%p1%][articlemessages]');
$Temp->MergeNavigationBar('nv','',$pn,$RecCnt,$PageSize);

Thx in advance!
By: Skrol29
Date: 2006-02-17
Time: 03:11

Re: limit result of block

Hi,

There is no TBS feature to do this, except the ByPage mode, like you've done.
If your data is an array, you could also do this :
$RecCnt = $Temp->MergeBlock('article',array_slice($articles,0,3)) ;

But why do you say that your currently use is a big deal?