[Zope] dtml-with problem

Mark Gibson mark@kaivo.com
Sat, 09 Nov 2002 13:57:30 -0700


Steffen Hausmann wrote:
> On Sat, Nov 09, 2002 at 12:54:20PM -0700, Mark Gibson wrote:
> 
>>Steffen Hausmann wrote:
>>

> 
> 
> I tried <dtml-with "_['myobjectname']"> before :(
> I didn't think about it properly...
> 
> Thanks.
> 
> Does someone know why
> 
> <dtml-var expr="objectname.title">
> 
> dosn't work.
Well, it depends what objectname is.
If objectname='nameoftheobject', then objectname is just a string. So 
in effect the above statement says "give me the attribute 'title' of 
this string". A string doesn't have an attribute of 'title', so it fails.

What you probably want to do is say something like
  <dtml-var expr="_[objectname].title">.

"_[objectname]" says "search the namespace for an object with the name 
contained in the string variable objectname and give it to me".

Mark


> 
> MfG Steffen