[Zope-CMF] CMF sorting objects help

Anton Hughes Anton.Hughes@utas.edu.au
Fri, 1 Aug 2003 10:42:18 +1000


Hi Eric,

As it happens, I'd just done the same thing myself recently. Here is the
code from index_html_utils I used to sort first on id then on date:

<div tal:define="auth_filter nocall: modules/ZTUtils/LazyFilter;
                   default_types python:( 'Document'
                                        , 'Image'
                                        , 'File'
                                        , 'FAQ'
                                        );
                   types types | here/show_content_types | default_types;
                   raw_items python: here.contentValues(
                                     filter={'portal_type': types } );
 			sort_on python:(('id', 'nocase', 'asc'),
('bobobase_modification_time', 'cmp', 'desc'));
			sorted_items python:sequence.sort(raw_items,
sort_on)
			items python: auth_filter( sorted_items, skip='View'
);">

Hope that helps...

Anton                  

-----Original Message-----
From: Eric Dunn [mailto:endunn@rocketmail.com]
Sent: Friday, 1 August 2003 10:34 AM
To: zope-cmf@zope.org
Subject: [Zope-CMF] CMF sorting objects help


Can anyone tell me how to sort the objects that are
viewed on the first page of the CMF.
I place "News Items" on the front page (as well as the
News block).  The "News" block on the right of the
screen lists the News latest to earliest.  I would
like to sort items on the front page in the same
manner.  They are earliest to latest right now and I
cannot find the code that controls the sorting.
I located the 
/ZOPE_INSTANCE/CMF/portal_skins/custom/index_html_utils

I found it displayed the front page content but I
cannot get the code correct that sorts in desc manner.
Can anyone help.
Thanks

=====
Eric N. Dunn
other email: endunn@aol.com

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

_______________________________________________
Zope-CMF maillist  -  Zope-CMF@zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests