[Zope] ZCatalog

Chris McDonough chrism@digicool.com
Mon, 17 Jul 2000 03:06:14 -0400


Jonathan,

Please respond to the list as well as to me so others can benefit.

What's happening here is that your catalog is named "s".  I should have
noticed this the first time around.  But I didn't.  The bit you want is:

<a href="<dtml-var "s.getpath(data_record_id_)">">
<dtml-var title>

Whether you use "raw" or "title" depends on what you want to see.  If
you want to see the "raw" DTML that makes up the object that gets
referenced in the catalog as a link, use "raw".  If you want to see the
title as a link, use "title".

If your catalog isn't named "s", and the DTML is actually wrong where it
says "<dtml-in s size=50 start=query_start>", change "s" to whatever the
catalog is named.

What Zope is doing:

1.  Iterating over the catalog in batches of fifty responses in the line
that says:

<dtml-in s size=50 start=query_start>

2.  Doing some stuff at the beginning of the batch (all the "if
sequence-start" stuff)

3.  Showing results, if any with a link (the bit you're adding) 

4.  Doing some stuff at the end of a batch (all the "if sequence-end"
stuff)

5.  Showing a meaningful message if there were no results.



Jonathan Desp wrote:
> 
> yes, so I quess:
> 
> <a href="<dtml-var "catalog.getpath(data_record_id_)">">
> <dtml-var title>
> 
> will become:
> 
> <a href="<dtml-var "catalog.getpath(data_record_id_)">">
> <dtml-var raw>
> 
> then I did it,
> 
> here I tryed  my search:
> 
> http://www.atomasoft.com/gosearch
> 
> and it's not working.
> 
> All is great with my source or I need to shutdown zope if I want to see the
> result working.. ?
> 
> Do you know if there is any other changing to do?
> 
> here is my new source again:
> 
> <dtml-var standard_html_header>
> <dtml-in s size=50 start=query_start>
>    <dtml-if sequence-start>
> 
>       <dtml-if previous-sequence>
> 
>         <a href="<dtml-var URL><dtml-var sequence-query
>                  >query_start=<dtml-var
>                  previous-sequence-start-number>">
>         (Previous <dtml-var previous-sequence-size> results)
>         </a>
> 
>       </dtml-if previous-sequence>
> 
>       <table border>
>         <tr>
>           <th>Raw</th>
>         </tr>
> 
>    </dtml-if sequence-start>
> 
>         <tr>
> <td><a href="<dtml-var "catalog.getpath(data_record_id_)">"><dtml-var
> raw></a></td>
>         </tr>
> 
>    <dtml-if sequence-end>
> 
>       </table>
>       <dtml-if next-sequence>
> 
>          <a href="<dtml-var URL><dtml-var sequence-query
>             >query_start=<dtml-var
>             next-sequence-start-number>">
>          (Next <dtml-var next-sequence-size> results)
>          </a>
> 
>       </dtml-if next-sequence>
>    </dtml-if sequence-end>
> 
> <dtml-else>
> 
>   There was no data matching this <dtml-var title_or_id> query.
> 
> </dtml-in>
> 
> <dtml-var standard_html_footer>