[Zope] Newbie <dtml-if> question

Nick Garcia ngarcia@codeit.com
Thu, 06 Apr 2000 11:51:07 -0700


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