[Zope] scoping problem?

Evan Simpson evan@4-am.com
Fri, 12 Nov 1999 15:55:26 +0000


Arjan Scherpenisse wrote:

> Hi,
>
> i have this code, to display a 'see also' block in my navigation bar,
> using a 'seealso' property in the folder. This property is a
> comma-seperated list of interesting id's.
>
> <dtml-call "REQUEST.set('links', _.string.splitfields(seealso,','))">
>   <dtml-in links>
>   <tr><td>
>     <a href="<dtml-var "absolute_url()">"><dtml-var title></a>
>   </td></tr>
>   </dtml-in>

You need to use the ids to fetch the actual objects.  Assuming that each
id is local (or can be acquired), you can use:

<dtml-call "REQUEST.set('links', _.string.splitfields(seealso,','))">
  <dtml-in links><dtml-with "_.getitem(_['sequence-item'])">
  <tr><td>
    <a href="<dtml-var "absolute_url()">"><dtml-var title></a>
  </td></tr>
  </dtml-with></dtml-in>

Cheers,

Evan @ 4-am