[Zope] expr="id <> 'index_html" issue

Rik Hoekstra rik.hoekstra@inghist.nl
Mon, 9 Oct 2000 22:24:41 +0200



> Okay, this is my second question for the day.  Hopefully it won't be as
easy as
> the first -- otherwise, I'll have to stick to practicing law.
>
> I'm looking for a way to list the DTML Methods in a folder -- except the
> index_html method.  So far, I've had to do it by using this:
>
> <dtml-in expr="objectValues('DTML Method')" sort="title">
>   <dtml-if expr="title <> 'The Title'">
>      <td align="center"><a href="&dtml-absolute_url;"><dtml-var
> title_or_id></a></td>
>   </dtml-if>
> </dtml-in>
>
>
> This works but it is a maintenance headache.  A more elegant (and
reuseable)
> solution would be to use the id, which is always 'index_html' for the
> to-be-excluded method.  However...
>
> <dtml-in expr="objectValues('DTML Method')" sort="title">
>   <dtml-if expr="id <> 'index_html'">
>      <td align="center"><a href="&dtml-absolute_url;"><dtml-var
> title_or_id></a></td>
>   </dtml-if>
> </dtml-in>
>
>
> .. doesn't work.
>
> Does anyone know why?

Short answer because id is not always a string you have to call it
differently

try <untested but this is a faq>:

<dtml-in expr="objectValues('DTML Method')" sort="title">
   <dtml-if expr="_[id] <> 'index_html'">
      <td align="center"><a href="&dtml-absolute_url;"><dtml-var
 title_or_id></a></td>
   </dtml-if>
</dtml-in>


hth
Rik