[Zope] Re: Could Someone Clean This DTML Up?

Maik Jablonski maik.jablonski@uni-bielefeld.de
Mon, 06 Jan 2003 21:12:39 +0100


beno wrote:
> At 02:28 PM 1/6/2003 +0000, you wrote:

> There were a couple of seeming syntax errors in here that made the 
> compiler hiccup, specifically double-quoting in line #3, but the real 
> reason I'm writing back is I know darn well that *objectsInTheFolder* 
> isn't how you call objects in the current container. How do I do that?
> TIA,
> beno
> 
> <dtml-let lang="REQUEST.get('HTTP_ACCEPT_LANGUAGE')">
>   <dtml-in expr="context.objectsInTheFolder">
>    <dtml-if expr="'&dtml-id;'=='&dtml-lang;'">
>     <dtml-call "REQUEST.set('approved', ['lang'])">
>    <dtml-else>
>     <dtml-call "REQUEST.set('approved', 'en-us')">
>    </dtml-if>
>   </dtml-in>
> </dtml-let>
> 

Hi,

you should change

 >   <dtml-in expr="context.objectsInTheFolder">

to:

<dtml-in objectValues>

and

 >    <dtml-if expr="'&dtml-id;'=='&dtml-lang;'">

to:

<dtml-if expr="getId()==lang">

You cannot nest dtml in dtml. And: Read THE ZOPE-BOOK!!!

-mj