[ZPT] Forms and Zcatalog

Tim Fouracre jhgfjhgfjhgf@hotmail.com
Tue, 17 Jul 2001 15:46:59 -0000


Ulrich Eck wrote:
>try
>
>tal:attributes="href string:${here/message}?body=${item/body}"

Thanks Ulrich, but that is actually what i currently use (which doesn't 
work):

    <a href="whats this?"
        tal:attributes="href string:${here/message}?body=${item/body}"
        tal:content="item/subject">Subject
    </a>

The
>>tal:attributes="href here/message?string:?body=${item/body}"
was just me trying to think of another way to do it (which also doesn't work 
:/

In trying to figure out what was going on i threw in a
<b tal:content="here/REQUEST/body></b> just to make sure i was getting the 
variable, and indeed it displays the body variable first time around when 
the Search_Results PT is called, but when i use the previous or next links 
for the batch process, it seems to lose what it is. Is that just because of 
the here/REQUEST statement or has the variable actually been 'lost'
Here is the entire code, if it helps
Thanks for the support
Tim


<html>
<b tal:content="here/body"></b>
  <table width="90%">
   <tr>
    <td width="40%"><b>Subject</b></td>
    <td width="40%"><b>From</b></td>
    <td width="20%"><b>Date</b></td>
   </tr>
<div tal:define="b_start python:path('request/b_start') or 0;
                 results container/zope/ZopeCatalog;
                 Batch python:modules['ZTUtils'].Batch;
                 global batch python:Batch(results, 2, 
int(b_start),orphan=1)"
        tal:replace="nothing"></div>
  <tr tal:repeat="item batch">
    <td>
     <a href="whats this?"
         tal:attributes="href string:${here/message}?body=${item/body}"
         tal:content="item/subject">Subject
     </a>
    </td>
    <td>
     <b tal:replace="item/sender">From</b>
    </td>
    <td>
     <b tal:replace="item/date">Date</b>
    </td>
   </tr>
   <tr tal:repeat="item container/zopedev/ZopeDevCatalog">
    <td tal:condition="here/REQUEST/selectzopedev">Searchword</td>
    <td></td>
   </tr>
  </table>
    <a href="previousbatch" tal:define="p batch/previous"
        tal:condition="p"
        tal:attributes="href string:?b_start=${p/first}">
       Previous <span tal:replace="p/length">p</span>
    </a>
    <a href="nextbatch" tal:define="n batch/next"
        tal:condition="n"
        tal:attributes="href string:?b_start=${batch/end}">
       Next <span tal:replace="n/length">n</span>
    </a>
</html>

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.