James, Create a Script(Python) called news_filter that has these contents: #---start of the filter retval=[] for a in objectValues(['Informatie', 'sitenieuws']): if has_key(a.aq_explicit,'publish'): retval.append(a) return retval #---end of filter then in your dtml method: <dtml-in news_filter start=query_start size="6" sort=bobobase_modification_time reverse> <dtml-var title> </dtml-in> caveat: all this is untested as it's written, but should give you some ideas. Phil ----- Original Message ----- From: "James van der Veen" <james@codenamefuture.nl> To: <zope@zope.org> Sent: Wednesday, August 22, 2001 12:39 PM Subject: [Zope] dtml-in and if
Hi everybody..
I have a question...
How should I do the folowing?
I now have this
<dtml-in "objectValues(['Informatie', 'sitenieuws'])" start=query_start size="6" sort=bobobase_modification_time reverse> <dtml-if "publish=='true'"> <dtml-var title> </dtml-if> This means it wil find all the objects if the publish property is true. But here is my problem. If if I want 6 of the titles on my frontpage (size=6) it doesn´t work because the fist 6 it might find aren´t publish = true I guess the thing I would want to do is the above code but than with a else bit that increases the sitze of the query if the publish property isn´t true. I guess it would look like this (tried this but doesn´t work)
<dtml-in "objectValues(['Informatie', 'sitenieuws'])" start=query_start size="6" sort=bobobase_modification_time reverse> <dtml-if "publish=='true'"> <dtml-var title> <dtml-else> <dtml-call "REQUEST.set('size', ['size' + '1'])"> </dtml-if>
Any clues on how to do this the right way...??
Hope someone can help me on this one!!
Greetz, James
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )