[Zope-CMF] How to limit the number of News Items being displayed

Steve Spicklemire steve@spvi.com
Sat, 28 Jul 2001 17:21:18 -0500


Hi Norman,

	The 'in' tag has the concept of 'orphans' so 'size' is a sort of 
'target' but you'll get more if the number of items left over is 
'small'. You can force orphans to be ignored by setting 'orphan="0"'

 From the  DTML ref:

Note that in the previous example the size of the last batch is six. 
This is because the dtml-in tag has a feature which attempts to prevent 
the display of very small batches by combining them with adjacent 
batches. Normally, if the number of rows in a batch is less than or 
equal to two, then it is combined with an adjacent batch. The orphan 
attribute in the dtml-in tag can be used to provide an alternative 
setting. The value provided in an orphan attribute is the desired 
minimum batch size. The default setting for an orphan attribute is 3 
(three).

On Saturday, July 28, 2001, at 05:16 PM, Norman Khine wrote:

> Hi Jens,
> Thanks, pretty simple, one thing though I am not sure if its me but 
> from the
>
> <dtml-in "portal_catalog.searchResults( meta_type='News Item'
>                                         , sort_on='Date'
>                                         , sort_order='reverse'
>                                         , review_state='published'
>                                         )" size="4">
>
> I change the size="1", and it renders only one news story, the same is 
> true
> for 2 and 3; BUT if I have 4, 5 it shows all six news items.
>
> I only have so far six news items, for some reason it doesn't like 
> anything
> above 3.
>
> Can somebody confirm this.
>
> Thanks
>
> Norman
>
> -----Original Message-----
> From: zope-cmf-admin@zope.org [mailto:zope-cmf-admin@zope.org]On Behalf
> Of Jens Vagelpohl
> Sent: 28 July 2001 19:36
> To: Norman Khine
> Cc: Zope-CMF
> Subject: Re: [Zope-CMF] How to limit the number of News Items being
> displayed
>
>
> add the size argument to your dtml-in. something like...
>
> <dtml-in expr="MethodThatGetsNewsItemsList()" size="5">
>    ...
> </dtml-in>
>
> jens
>
>
>
> On Saturday, July 28, 2001, at 02:04 , Norman Khine wrote:
>
>> Hi,
>> Simple I think for those in the know;^)
>>
>> Can you tell me how to limit the display of the news items to only show
>> the
>> latest 5 published news items, anything beyond that to be in the 
>> more ...
>> .
>> link
>>
>> Cheers
>>
>> Norman
>> zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
>> zz/********/z/****\zzz|****\*\zz|*******|z
>> z/^^^^^^^^/z/******\zz|*^^^^|*|z|*|^^^^^|z norman khine
>> zzzzzz/**/z|**/^^\**|z|*|zzz|*|z|*|zzzzzzz mailto:norman@khine.net
>> zzzzz/**/zz|*|zzzz|*|z|****/*/zz|*****|zzz purley
>> z/******/zz|*|zzzz|*|z|*|^^zzzzz|*|^^^|zzz UK
>> zzZ/**/zzzz|**\^^/**|z|*|zzzzzzz|*|zzzzzzz
>> zz/******/zz\******/zz|*|zzzzzzz|*|*****|z
>> z/^^^^^^/zzzz\^^^^/zzz|^|zzzzzzz|^^^^^^^|z
>> zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
>>
>>
>>
>> _______________________________________________
>> Zope-CMF maillist  -  Zope-CMF@zope.org
>> http://lists.zope.org/mailman/listinfo/zope-cmf
>>
>> See http://www.zope.org/Products/PTK/Tracker for bug reports and 
>> feature
>> requests
>
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cmf
>
> See http://www.zope.org/Products/PTK/Tracker for bug reports and feature
> requests
>
>
>
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cmf
>
> See http://www.zope.org/Products/PTK/Tracker for bug reports and 
> feature requests