[Zope] Kind of a CMF-Qusetion...

Thomas @ HeadNet stoons@headnet.dk
Fri, 31 May 2002 23:30:39 +0200


Hi Zopers from around the world...

I am going to ask a Q that I actually have solved, but if there are other
solutions I would like to know...

The thing is that we (headnet) are trying to "tune-up" the great prod CMF..

One thing that is missing is "Manual Sort"....
This means that we would like to make the customers able to use a manual
sort-order of misc objects...

Here is one example:

Problem:
=========
If you create a new news-item and you really want it to be top news for a
lonmg time... how to do this...?

Headnet-Solution:
=========
We made a (very simple) script like this:
name(id) of the script: reelsort
parameter list: L=[]
=========
L2=[]
for item in L:
  L2=L2+[item.getObject()]
return L2
=========
(btw: is there any other way to do this .. ?)

The reason for this is that when you use portal_catalog(meta_type='xxx',
review_state='yyy') you cannot sort by it after for instance
getObject().zzz, because it is not included in the catalog metadata /
indexes.....

furthermore we added a property (SortID) to the objects (news) and replaced
the "<dtml-in "portal_catalog(meta_type='News Item',
review_state='published')"> - instances with : <dtml-in
"reelsort(portal_catalog(meta_type='News Item', review_state='published'))"
sort=SortID> and a bit of fiddling with the getUrl and getObject....

result: we can now sort news (and other) manually...

So back to the q: Is there any other suggestions.... = )

/Stoons @ :HeadNet:

PS: I hope you can understand my "Denglish", I am from Denmark = )