[CPS-users] How to sort items in sections, portlets, etc.?

Jean-Marc Orliaguet jmo at ita.chalmers.se
Tue Apr 11 09:36:56 CEST 2006


curios-one wrote:

>Thank you very much Jean-Marc,
>I would really appreciate if you could send me the code.
>
>  
>

OK, see the attached files. They do more than you need, there is a field 
called 'alphabetical_order' on the section which is either True or False.


then it is passed to getFolderItems():

    sort_by = alphabetic_order and 'title' or ''

    folderItems = context.getFolderItems(context_obj=context_obj, 
show_docs=1,
                  max_title_words=10, display_hidden_folders=0,
                  display_valid_docs=1, sort_by=sort_by)

you can sort by 'date', 'title', 'author',  and invert the sorting order 
with 'sort_direction' = 'desc' or 'asc'

see:
CPSPortlets/skins/cpsportlets_widgets/getFolderItems.py

>I also have another question, how is used getCustomDisplayParams.py?
>
>  
>
this one belongs to CPSDefault, I'm not sure about what it does.

>Thanks again
>C.
>  
>

you're welcome /JM
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getNavigationInfo.py
Type: text/x-python
Size: 1963 bytes
Desc: not available
Url : http://lists.nuxeo.com/pipermail/cps-users/attachments/20060411/e0a8d057/getNavigationInfo.py
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nuxeo.com/pipermail/cps-users/attachments/20060411/e0a8d057/custom_navigation.html


More information about the cps-users mailing list
More information about CPS: CPS project - CVS - API

Hosting: Nuxeo: Zope service provider


This list archive provided by Nuxeo, the leaders of open source ECM. Check out the Nuxeo 5 open source, standards-based ECM project.