Document Actions

How to list folder contents in plone-2.1 on the basis of creation date?

by shalini last modified 2006-12-04 15:18

In Plone whenever a content is added it get displayed in the end of folder listing. It creates a lot of problem while searching for that content if the number of contents are large in number .

To overcome this drawback we have to change plone default  ordering  of folder  contents on the basis of their 'Creation Date'.



Make the following changes in   portal_skins/plone_scripts/getFolderContents :

<!-Replace    the following code  with the below given code ---------> 

if not contentFilter.get('sort_on', None):
    contentFilter['sort_on'] = 'getObjPositionInParent'
<------------------------------------------------------------------>



if not contentFilter.get('sort_on' ,None ):  
    contentFilter['sort_on'] = 'created'


if not contentFilter.get('sort_order' ,None ):  
    contentFilter['sort_order'] = 'reverse'





NOTE:

Sorting is done in two steps:
1) In the above code sorting is done on the basis of creation date by  using ---> sort_on = 'created'
2) reverse list using ----> sort_order ='reverse'





 

 

 
Contact: OneWorld South Asia, C-5 Qutab Institutional Area, New Delhi 110016, Tel: 91-11-4168 9000, Fax: 91-11-4168 9001
Email: webmaster at ekduniya dot net