[Zope] Newbie <dtml-if> question

Stuart Foster stuartf@MediServe.com
Thu, 6 Apr 2000 13:34:59 -0700


This worked perfectly I thank all of you for your replies.

-----Original Message-----
From: Nick Garcia [mailto:ngarcia@codeit.com]
Sent: Thursday, April 06, 2000 11:51 AM
To: Stuart Foster
Cc: 'zope@zope.org'
Subject: Re: [Zope] Newbie <dtml-if> question


Stuart Foster wrote:
> 
> I have the following statement:
> 
> <dtml-if "'<dtml-var id>.jpg' in somelist">
>   DoSomething
> </dtml-if>
> 
> id is some arbitrary numeric value that will change.
> 
> Is the If tag being resolved to: <dtml-if "'1.jpg' in somelist">
> or <dtml-if "<dtml-var id>.jpg in somelist">

The second one.  You can't have dtml inside dtml.  Instead, what you
need to do is this:

<dtml-if "id + '.jpg' in somelist">

Actually... if id is numeric then you need to do:

<dtml-if "_.str(id) + '.jpg' in somelist">

-- 
Nick Garcia | ngarcia@codeit.com
CodeIt Computing | http://codeit.com

_______________________________________________
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 )