Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Well, it may be appears a little bit tricky, cause this approach comes natural when managing db results set.</p> <p>You can refer here: <a href="http://docs.zope.org/zope2/zope2book/AppendixC.html#the-following-information-is-available-from-the-repeat-variable" rel="nofollow">http://docs.zope.org/zope2/zope2book/AppendixC.html#the-following-information-is-available-from-the-repeat-variable</a></p> <p>The tal:repeat statement is very powerful and, in your case you can count on "first" variable information.</p> <p>Instead of a simple List of Events, try to iterate over a list of dictionaries in which you take care of isPast information.</p> <p>Run the following (simple and brutal) tal code... it is self explaning.</p> <pre><code>&lt;div tal:define="past string:Past events; future string:Events to Come; richList python:[{'event':'event1', 'passed': past}, {'event':'event2', 'passed': future}, {'event':'event3', 'passed': past}, {'event':'event4', 'passed': future}]; dummy python:richList.sort(lambda x,y:cmp(x['passed'], y['passed']))"&gt; &lt;tal:block repeat="item richList"&gt; &lt;h2 tal:condition="repeat/item/first/passed" tal:content="item/passed"&gt; Past Events or Future &lt;/h2&gt; &lt;a tal:content="item/event"&gt;event's url&lt;/a&gt; &lt;/tal:block&gt; &lt;/div&gt; </code></pre> <p>You can create your richList iterating on the result of a catalog call. And you can create the dictionary item seting 'passed' value according with event/end/isPast function.</p> <p>hope this helps.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload