[Zope] Could Someone Clean This DTML Up?
beno
zope@thewebsons.com
Mon, 06 Jan 2003 15:42:59 -0400
At 07:06 PM 1/6/2003 +0000, you wrote:
><dtml-in objectValues>
>will loop you the the objects in the current container
By way of trouble-shooting, I threw in a couple of <dtml-var> tags to print
stuff to screen. *lang* prints: *id* doesn't. Therefore, the loop isn't
functioning. There must be a problem with the calling variable
*objectValues*. I've tried all sorts of ways around this to no avail.
Further suggestions?
TIA,
beno
<dtml-let lang="REQUEST.get('HTTP_ACCEPT_LANGUAGE')">
<dtml-var lang>
<dtml-in objectValues>
<dtml-var id>
<dtml-if expr="'&dtml-id;'=='&dtml-lang;'">
<dtml-call "REQUEST.set('approved', ['lang'])">
<dtml-var approved>
<dtml-else>
<dtml-call "REQUEST.set('approved', 'en')">
<dtml-var approved>
</dtml-if>
</dtml-in>
</dtml-let>
>beno wrote:
>>At 02:28 PM 1/6/2003 +0000, you wrote:
>>
>>><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>
>>
>>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>
>>
>>_______________________________________________
>>Zope maillist - Zope@zope.org
>>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 )
>
>