[Zope] ZCatalog previous and next items in list

2000-05-30 Thread Chris Crownhart

I am using a dtml-in to walk through a catalog and display the results
for a given query.  When someone clicks on an item in a list, I would
like to be able to pass the id of the item above it and below it.  For
example,

Given this result set:

Title   Desc
-   --
Item 1  This is item 1.
Item 2  This is item 2.
Item 3  This is item 3.

If the user click on Item 2, I want to pass the id of Item 1 and Item 3
to the next page.  Does either dmtl-in or ZCatalog provide a variable
that stores the id's for those (i.e. something like 'sequence-1' and
'sequence+1')?

Thanks,

Chris

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] ZCatalog previous and next items in list

2000-05-30 Thread Dieter Maurer

Hi Chris,

  I am using a dtml-in to walk through a catalog and display the results
  ...
  If the user click on Item 2, I want to pass the id of Item 1 and Item 3
  to the next page.
"dtml-in" iterates over a sequence. You can directly access elements
of the sequence. This looks like:

dtml-let S=sequence
  dtml-in S
dtml-var "S[_['sequence-index']-1].data_record_id_"
  /dtml-in
/dtml-let

Of cause, you must handle boundary problems, maybe with dtml-try
or dtml-if.


Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
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 )