[Zope] dtml-in question

Peter Arvidsson peter@innodev.com
Tue, 01 Aug 2000 16:30:32 +0200


Hi

I had the same problem and found out there is no way yet of making dtml-in with
multiple conditions. Instead I had to do dtml-if's and make my own counter and
previous/next attributes to handle the batches.

Peter


Webmaster skrev:

> I have a bunch of zClass instances and I want to display only the ones that
> match all three criterion (approved=1, goLiveDate<=ZopeTime(), expired=0).
> I'm not exactly sure how to do this. I have tried <dtml-if> statements
> inside the <dtml-in></dtml-in> statements but the "in", even though it does
> not show the files that don't match, still counts all of them which messes
> up the next and previous. How do I write my code to correctly show and count
> only the matching instances?
>
> I have searched both the zope.org site and the eGroups list for the answer
> and if it is there I can't find it :-(
>
> Thanks!!
>
> Jamey
>
> Here is the code.
>
> <dtml-in "PARENTS[0].objectValues(['PressRelease'])" sort="goLiveDate"
> reverse size="5" start="batch_start" next>
>  <p>
>  <a
> href="&dtml-URL;&dtml-sequence-query;batch_start=&dtml-next-sequence-start-n
> umber;">
>  Next &dtml-next-sequence-size; older Releases
>  </a>
> </dtml-in>
>
> <dtml-in "PARENTS[0].objectValues(['PressRelease'])" sort="goLiveDate"
> reverse size="5" start="batch_start">
>  <dtml-if "goLiveDate <= ZopeTime">
>   <p><b><a href="<dtml-var "id">/release.html">
>     &dtml-pr_title;
>    </a></b> - <dtml-var goLiveDate fmt="%m/%d/%Y"><br>
>     <font size="2">&dtml-summary;</font>
>    </p>
>  </dtml-if>
> </dtml-in>
>
> <dtml-in "PARENTS[0].objectValues(['PressRelease'])" sort="goLiveDate"
> reverse size="5" start="batch_start" previous>
> <p>
>  <a
> href="&dtml-URL;&dtml-sequence-query;batch_start=&dtml-previous-sequence-sta
> rt-number;">
>  Next &dtml-previous-sequence-size; more recent Releases
>  </a>
> </dtml-in>
>
> _______________________________________________
> 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 )