[Zope] How to test a file ?

Ben Leslie benno@sesgroup.net
Wed, 8 Sep 1999 19:02:37 +1000


Hi Arnaud!

On Wed, 08 Sep 1999, Arnaud Lecat wrote:

> Hi
> 
> I have a dtml-in loop which cycle through documents of a directory. How
> can I test
> if the current item in the loop is the document wich is displayed at the
> moment ?
> 
> It's for sidebar menu purpose. I'd like to make the current document
> bold or something
> else...
> 
> I've heard that such a menu could be made with a ZCatalog component. Is
> that true ? How ?


I have just spent all day playing around with this I cam up with something
like this

<dtml-let temp=id>
 <dtml-with "PARENTS[0]">
  <dtml-in "objectValues(['DTML Document'])" sort=title>
   <dtml-if temp=="_['id']">
    <B><dtml-var title>
   <dtml-else>
    <A HREF="<dtml-var id>"><dtml-var title></A>
   </dtml-if>
  </dtml-in>
 </dtml-with>
</dtml-let>


Now, that was of the top of my head so it may not work, but I think that 
is the general plan of attack.


Cheers,

Benno