[Zope] Re: Still Having Problems With DTML

beno zope@thewebsons.com
Thu, 16 Jan 2003 05:12:19 -0400


At 07:52 PM 1/15/2003 +0100, you wrote:
>beno wrote:
>>This is becoming far_more_complex than I anticipated. I would love to be 
>>able to do something like this:
>
>I don't know what you want to do, but please try it this way:
>
><dtml-let lang="REQUEST.get('HTTP_ACCEPT_LANGUAGE','en-us')">
>   <dtml-in objectValues>
>     <dtml-let langShort="lang[2:]">
>      <dtml-var langShort>
>      <dtml-if expr="getId()==langShort">
>       <dtml-var sequence-item>
>      </dtml-if>
>     </dtml-let>
>   </dtml-in>
></dtml-let>

Okay, I think I'm almost there :) Here's what I've got now:

<dtml-let lang="REQUEST.get('HTTP_ACCEPT_LANGUAGE','en-us')">
  <dtml-in objectValues>
   <dtml-let langShort="lang[:2]">
    <dtml-let x=getId>
     <dtml-let y="x[:2]">
      langShort: <dtml-var langShort>
      y: <dtml-var y>
      <dtml-if expr="y==langShort">
       Why does this print now??? <dtml-var y>
      </dtml-if>
     </dtml-let>
    </dtml-let>
   </dtml-let>
  </dtml-in>
</dtml-let>

The strange (to me) thing is, if I don't have the *langShort:* and *y:* 
print statements, then *Why does this...* doesn't print! But if I do have 
them, then it does! Obviously, I would like things to work without having 
unnecessary print statements. What am I missing?
TIA,
beno