[Zope-CMF] plone: related_slot
Jan Ulrich Hasecke
janulrich.hasecke@web.de
Fri, 05 Jul 2002 22:06:23 +0200
"alan runyan" <runyaga@runyaga.com> writes:
> use the source luke
I know the source is anywhere out there, but...=20
I've found this, but I cannot see where the and-or logic is located.
,----
| ## Script (Python) "navigationLocalRelated"
| ##bind container=3Dcontainer
| ##bind context=3Dcontext
| ##bind namespace=3D
| ##bind script=3Dscript
| ##bind subpath=3Dtraverse_subpath
| ##parameters=3Dobj=3DNone
| ##title=3Dencapsulates the related box
| ##
|=20
| listing=3D()
|=20
| if obj is None:
| obj=3Dcontext
|=20
| if hasattr(obj, 'Subject') and obj.Subject(): #shared same metadata=20=20
| for o in context.portal_catalog(Subject=3D{'query':obj.Subject()}):
| url=3Do.getURL()
| if url.find(obj.absolute_url())=3D=3D-1:
| if o.Title:
| listing+=3D( (o.Title, url), )
| else:
| listing+=3D( (o.id, url), )
|=20
| return listing
`----
Ciao!
juh
--=20
ILOVEYOU. Ich hab's ge=F6ffnet.
http://www.sudelbuch.de/2000/20000505.html